Valhalla Legends Forums Archive | Web Development | PHP Help:

AuthorMessageTime
Crazy_X
I can't seem to run an index.php I just compiled.

Parse error: parse error, unexpected '<', expecting T_CASE or T_DEFAULT or '}' in C:\*\*\*\*\*\*\*.tmp on line 22.

Ive completly debugged it and there are no errors. Yet when I try to run it that message pops up. Forgive me if this is a common error but I can't seem to fix it.
Any help is appreciated.

~Crazy
December 16, 2003, 2:05 AM
AssassinRC
If you post the code i'll go through and find the bug for you. :)
December 16, 2003, 2:49 AM
j0k3r
Note that the error in PHP is relative, the error *MIGHT* be on line 21.

Post the code with the error.
December 16, 2003, 2:57 AM
AssassinRC
At least post ~5 lines before / after line 22. So 17-27 respectively.
December 16, 2003, 7:01 AM
Crazy_X
<?php

?>case 'members':
include 'modules/members/members.php';
break;

case 'public%files':
include 'modules/downloads/downloads.php';
break;

Is the code from the specified section. All the mods. fully work and there are no bugs in them. I tried recompiling it this morning and more errors came up. It continually redirects me to line(s) 19,20,21.

argh.....

There are no errors there but the little bugger keeps saying it's error ridden. I know its something very very simple that I forgot but it's just not coming to me.
Thanks
December 16, 2003, 2:31 PM
j0k3r
[quote author=Crazy_X link=board=22;threadid=4269;start=0#msg35711 date=1071585083]
<?php

?>
case 'members':
include 'modules/members/members.php';
break;

case 'public%files':
include 'modules/downloads/downloads.php';
break;
[/quote]
Your code is outside the php tags, unless you screwed up the post I doubt that would work...
Other than that it looks right, unless 'public%files' is invalid.
December 16, 2003, 4:36 PM
Crazy_X
My fault, was in a hurry to get to school.
The % isn't on the line the so called "error" is on.
:-\
December 16, 2003, 4:42 PM
RyanIdium
the code snippet that you posted looks like its being used as a redirect for an action thats is directed by the url (like this forum). might i suggest handeling it like yabbse does and have an array of pointed arrays ( array("action1" => array('function',"file_to_include.php"));) Just a thought...
December 17, 2003, 1:20 AM
j0k3r
Highlight line 20?

IIRC, in some programming languages (PHP included I think), "/" is used for special characters/functions, such as "/n" for new line, so you have to use "//".
December 17, 2003, 2:39 AM
Skywing
[quote author=j0k3r link=board=22;threadid=4269;start=0#msg35875 date=1071628770]
Highlight line 20?

IIRC, in some programming languages (PHP included I think), "/" is used for special characters/functions, such as "/n" for new line, so you have to use "//".
[/quote]
I believe you are thinking of the mostly-standard escape character, \.
December 17, 2003, 3:38 AM
St0rm.iD
Your php tags are totally beserk.
December 17, 2003, 3:42 AM
RyanIdium
[quote author=St0rm.iD link=board=22;threadid=4269;start=0#msg35904 date=1071632540]
Your php tags are totally beserk.
[/quote]

he said that he rushed it becuase he had to go to school, so im thinking he just copied and pasted in a bad spot. but he put the php tags there, well, for extra info? idk acutaly, but he put them there :P
December 17, 2003, 4:00 AM
AssassinRC
That code bit won't help us at all. Post the entire file and we can work with it, but a sample like that with broken tags doesn't really work.
December 17, 2003, 5:58 AM
St0rm.iD
[quote author=Crazy_X link=board=22;threadid=4269;start=0#msg35732 date=1071592928]
My fault, was in a hurry to get to school.
The % isn't on the line the so called "error" is on.
:-\

[/quote]

Doesn't say anything about the tags though.
December 18, 2003, 12:06 AM

Search