PHP parse error: unexpected {
Hi,
I'm a newbie learning PHP, trying to write a dynamic menu bar. I am getting stuck on a parsing error "Parse error: syntax error, unexpected '{' in /home/karensga/public_html/Inc/KGDmenu.php on line 14". I have matching {} on all the FORs and IFs, but i must be missing something. I'm using Quanta+ 3.5.9 to write my code. Any help would be greatly appreciated. I'm calling the file "Inc/KGDmenu.php" from my home page with PHP Code:
PHP Code:
|
I'm no PHP expert but at first glance your code seems to be missing a closing ")".
Code:
//THE FOLLOWING LINE IS THE ONE CAUSING PROBLEMS Code:
//THE FOLLOWING LINE IS THE ONE CAUSING PROBLEMS |
Thank you. That was it. I knew I was missing something but I couldn't see it.
|
I recommend to use an editor which shows you matching parenthesis/braces. Quanta and Kate do automatic highlighting, joe does it with a key combination, and I assume vi and vim have that functionality as well.
jlinkels |
ya, vim does show it (as long as it's on the same visible page of the screen ;) not sure how it works in gvim)
as you say you're new to php (coding in general? ), one good thing to learn from early on is good line indention, also helps a lot with reading it and finding errors quicker (unless it's just the forums here screwing up the indentions in above php block ;) |
All times are GMT -5. The time now is 12:15 AM. |