Help me again!!!

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Mon Jul 11, 2005 12:03 am    Post subject: Help me again!!! Reply with quote

Code:

<?php
$today = date("F-d-Y");
DEFINE ("CREATION","July-10-2005");
echo "This documents was created on ";
echo CREATION;
echo ". Todays date is ";
echo "$today";
echo ". <br>";
echo "It is todays update if the two days

match.<br><br><br>";
echo "Now for arrays... I'll store 3 names in a array, sort

them alphabetically, then display them.";
$array[1] = "John Smith<br>";
$array[2] = "Jane Doe <br>";
$array[3] = "Dumb Er <br>";
asort ($array)
echo "OK - The array has been created and sorted! Now for

the display. Array:<br><br>";
echo $array;
echo "<br><br> See? OK, now I'll add P3 to the

array.<br><br>";
$array[4] = "P3";
echo "Now, here is the new array.<br>";
echo "$array"
echo "<br><br> That wasn't to hard!<br><br><br>";
echo "This is the end of today update - Check back tomorrow

for a new one!<br>";
echo "Click back to return to the previous page";
?>

More problem with my friends scripts... help me again please!!!

Thanks much!
Back to top View user's profile Send private message Send e-mail
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Mon Jul 11, 2005 1:31 am    Post subject: Reply with quote

You could at least admit they're your own script...

"Yes, doctor, I've got a friend and he's got this wierd spot..."

You're missing semi colons. Again. Learn to use the debugger, these are elementary errors.
Back to top View user's profile Send private message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Mon Jul 11, 2005 2:22 am    Post subject: Reply with quote

This is even worse than p3's coding...

Anyway, I'm going to tell you some really basic PHP-coding


Code:
<?
code here
?>


Use ";" after a command like echo.

Use \n instead of a new line, looks better.

Putting a variable between " just makes the site slower.
echo "$today"; > echo $today;

Code:
DEFINE ("CREATION","July-10-2005");
echo "This documents was created on ";
echo CREATION;


change to:

Code:

$created = "July-10-2005":
echo "This documents was created on $created";



Code:

echo "Click back to return to the previous page";


<a href="oldsite.html">Back</a>

Code:

asort ($array)

BASIC STUFF FFS!!!!11one
Back to top View user's profile Send private message
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Mon Jul 11, 2005 2:56 am    Post subject: Reply with quote

Anonymoose wrote:
You could at least admit they're your own script...

"Yes, doctor, I've got a friend and he's got this wierd spot..."

You're missing semi colons. Again. Learn to use the debugger, these are elementary errors.

A) Missing semicolons where???
B) I don't have a debugger!!
Back to top View user's profile Send private message Send e-mail
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Mon Jul 11, 2005 2:59 am    Post subject: Reply with quote

p3 wrote:
Anonymoose wrote:
You could at least admit they're your own script...

"Yes, doctor, I've got a friend and he's got this wierd spot..."

You're missing semi colons. Again. Learn to use the debugger, these are elementary errors.

A) Missing semicolons where???
B) I don't have a debugger!!


www.php.net/manual

Learn the basic, then ask us. You wont get your 1337-skillz by asking other people.
Back to top View user's profile Send private message
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Mon Jul 11, 2005 2:59 am    Post subject: Reply with quote

EDIT : See Next Post

Last edited by p3 on Mon Jul 11, 2005 3:29 am; edited 2 times in total
Back to top View user's profile Send private message Send e-mail
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Mon Jul 11, 2005 2:59 am    Post subject: Reply with quote

www.php.net/manual

How many times do i have to say this to you? RTFM!
Back to top View user's profile Send private message
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Mon Jul 11, 2005 3:29 am    Post subject: Reply with quote

[quote = "cmxflash"]
This is even worse than p3's coding...

[/quote]
For once, we agree on something :).

Anyways, the problem still exists!
Back to top View user's profile Send private message Send e-mail
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Mon Jul 11, 2005 3:30 am    Post subject: Reply with quote

cmxflash wrote:
www.php.net/manual

How many times do i have to say this to you? RTFM!


And that is going to tell me the problem...?
Back to top View user's profile Send private message Send e-mail
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Mon Jul 11, 2005 9:49 am    Post subject: Reply with quote

p3 wrote:

And that is going to tell me the problem...?


Actually, you're right. I don't think there is a page in the manual for "What to do if you are going to claim to have read the manual but actually ignore it and demand other people fix your sloppy coding for you."

p3 wrote:

A) Missing semicolons where???
B) I don't have a debugger!!


PHP is quite capable of helping you debug your scripts.

Here's what happens when I copy your code to a PHP file and load it in Abyss.



This gives you a clue. Something is amiss! Where could the problem be? Perhaps it is at line 18/19! Being a C++ coder you'll know that an error on the end of a previous line can lead to the next line being flagged as a problem... Won't you?

Load your PHP file in a decent text editor. I've switched line numbers on in mine as I wasn't sure if you'd be able to count to 19 without asking the forum how to do it.



Well look at that! Someone missed a semi colon at the end of line 18.

Keep repeating this process until your script processes without errors, or reread your code and manually spot the missing semicolons.

Once again, these are basic errors that with 2 seconds of rereading the script, considering you are capable - allegedly - of programming in other languages. Learn basic syntax before trying to help others.
Back to top View user's profile Send private message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Mon Jul 11, 2005 12:26 pm    Post subject: Reply with quote

Go Anonymoose, go Anonymoose.
Back to top View user's profile Send private message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Mon Jul 11, 2005 12:36 pm    Post subject: Reply with quote



Well, I put your little script in kwrite, and the problem was found.
Back to top View user's profile Send private message
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Mon Jul 11, 2005 3:33 pm    Post subject: Reply with quote

EDIT: Problem Solved

Last edited by p3 on Mon Jul 11, 2005 4:03 pm; edited 1 time in total
Back to top View user's profile Send private message Send e-mail
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Mon Jul 11, 2005 3:35 pm    Post subject: Reply with quote

Let me guess. You disabled errors and notices in your php.ini.
Back to top View user's profile Send private message
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Tue Jul 12, 2005 9:55 pm    Post subject: Reply with quote

would he know how to do that :D
_________________
Olly
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group