View previous topic :: View next topic |
Author |
Message |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Mon Jul 11, 2005 12:03 am Post subject: Help me again!!! |
|
|
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 |
|
 |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Mon Jul 11, 2005 1:31 am Post subject: |
|
|
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 |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Mon Jul 11, 2005 2:22 am Post subject: |
|
|
This is even worse than p3's coding...
Anyway, I'm going to tell you some really basic PHP-coding
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>
BASIC STUFF FFS!!!!11one |
|
Back to top |
|
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Mon Jul 11, 2005 2:56 am Post subject: |
|
|
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 |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Mon Jul 11, 2005 2:59 am Post subject: |
|
|
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 |
|
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Mon Jul 11, 2005 2:59 am Post subject: |
|
|
EDIT : See Next Post
Last edited by p3 on Mon Jul 11, 2005 3:29 am; edited 2 times in total |
|
Back to top |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Mon Jul 11, 2005 2:59 am Post subject: |
|
|
www.php.net/manual
How many times do i have to say this to you? RTFM! |
|
Back to top |
|
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Mon Jul 11, 2005 3:29 am Post subject: |
|
|
[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 |
|
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Mon Jul 11, 2005 3:30 am Post subject: |
|
|
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 |
|
 |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Mon Jul 11, 2005 9:49 am Post subject: |
|
|
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 |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Mon Jul 11, 2005 12:26 pm Post subject: |
|
|
Go Anonymoose, go Anonymoose. |
|
Back to top |
|
 |
cmxflash -
Joined: 11 Dec 2004 Posts: 872
|
Posted: Mon Jul 11, 2005 12:36 pm Post subject: |
|
|
Well, I put your little script in kwrite, and the problem was found. |
|
Back to top |
|
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Mon Jul 11, 2005 3:33 pm Post subject: |
|
|
EDIT: Problem Solved
Last edited by p3 on Mon Jul 11, 2005 4:03 pm; edited 1 time in total |
|
Back to top |
|
 |
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Mon Jul 11, 2005 3:35 pm Post subject: |
|
|
Let me guess. You disabled errors and notices in your php.ini. |
|
Back to top |
|
 |
olly86 -
Joined: 25 Apr 2003 Posts: 993 Location: Wiltshire, UK
|
Posted: Tue Jul 12, 2005 9:55 pm Post subject: |
|
|
would he know how to do that :D _________________ Olly |
|
Back to top |
|
 |
|