PDA

View Full Version : Parse Error?



nobody
July 28th, 2003, 12:41 PM
I'm trying to include a file "menu.inc" into my page, and when I go to the test page I set up it returns:
"Parse error: parse error in /home/xxviiine/public_html/menu.inc on line 3"

This is what is in the .inc file

<?php
$menuArray[0] = '<font size="2"><b><a href="http://www.xxviii.net/main.php">Main</a></b></font>'
$menuArray[1] = '<font size="2"><b><a href="http://www.xxviii.net/photoshop/index.php">Photoshop</a></b></font>'
$menuArray[2] = '<font size="2"><b><a href="http://www.xxviii.net/disclaimer.php">Disclaimer</a></b></font>'
$menuArray[3] = '<font size="2"><b><a href="http://www.xxviii.net/contact.php">Contact</a></b></font>'
$menuArray[4] = '<font size="2"><b><a href="http://www.xxviii.net/vb">Forums</a></b></font>'
$num = sizeof($menuArray);
for($i=0; $i<$num; $i++) echo "$menuArray[$i] ";
?>

absolutely no clue why I'm getting an error.... any help would be awesome

DigitalPimp
July 28th, 2003, 01:31 PM
I know nothing about php but would the space in "$menuArray[$i] " make a difference? Also, why are you doing your navigation like that? Is there any particular reason?

nobody
July 28th, 2003, 01:40 PM
The space isn't the problem. The problem should be somewhere on line 3.. but I just can't seem to place it.

I'm doing the menu like this becaues it is for a tutorial site and there will potentially be hundreds of pages so If I need to make even a minor adjustment to the menu I only have to edit one page as apposed to like 100.

DigitalPimp
July 28th, 2003, 01:42 PM
Well if PHP debugging is anything like ASP debugging, even though it says that it is on line 3 doesn't necessarilly mean that. I wish I could be of more help but I have no freaking clue about PHP.

I understand the include part but why are you putting the menu links into an array?

nobody
July 28th, 2003, 01:44 PM
They're in an array so I can easily add items and it will still put them into the menu with the for loop.
Thanks for helpin out so far.. at least now I know it could be on a different line.

DigitalPimp
July 28th, 2003, 01:46 PM
Shouldn't there be a semi-colon after you close the string?

nobody
July 28th, 2003, 01:48 PM
HAHA!
I think that's it..
oh man

nobody
July 28th, 2003, 01:49 PM
YES!
That was it!!!!!
Wow.. I hate that.. I always do something really stupid like that
thanks so much man

DigitalPimp
July 28th, 2003, 01:50 PM
haha your welcome. That's funny, I've never like looked @ php before in my life. Crap like that makes me a happy person.