Valhalla Legends Archive

Programming => Web Development => Topic started by: Crazy_X on December 15, 2003, 08:05 PM

Title: PHP Help:
Post by: Crazy_X on December 15, 2003, 08:05 PM
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
Title: Re:PHP Help:
Post by: AssassinRC on December 15, 2003, 08:49 PM
If you post the code i'll go through and find the bug for you. :)
Title: Re:PHP Help:
Post by: j0k3r on December 15, 2003, 08:57 PM
Note that the error in PHP is relative, the error *MIGHT* be on line 21.

Post the code with the error.
Title: Re:PHP Help:
Post by: AssassinRC on December 16, 2003, 01:01 AM
At least post ~5 lines before / after line 22. So 17-27 respectively.
Title: Re:PHP Help:
Post by: Crazy_X on December 16, 2003, 08:31 AM
  <?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
Title: Re:PHP Help:
Post by: j0k3r on December 16, 2003, 10:36 AM
Quote from: Crazy_X on December 16, 2003, 08:31 AM
 <?php

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

 case 'public%files':
     include 'modules/downloads/downloads.php';
     break;
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.
Title: Re:PHP Help:
Post by: Crazy_X on December 16, 2003, 10:42 AM
My fault, was in a hurry to get to school.
The % isn't on the line the so called "error" is on.
:-\
Title: Re:PHP Help:
Post by: RyanIdium on December 16, 2003, 07:20 PM
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...
Title: Re:PHP Help:
Post by: j0k3r on December 16, 2003, 08:39 PM
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 "//".
Title: Re:PHP Help:
Post by: Skywing on December 16, 2003, 09:38 PM
Quote from: j0k3r on December 16, 2003, 08:39 PM
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 "//".
I believe you are thinking of the mostly-standard escape character, \.
Title: Re:PHP Help:
Post by: Banana fanna fo fanna on December 16, 2003, 09:42 PM
Your php tags are totally beserk.
Title: Re:PHP Help:
Post by: RyanIdium on December 16, 2003, 10:00 PM
Quote from: St0rm.iD on December 16, 2003, 09:42 PM
Your php tags are totally beserk.

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
Title: Re:PHP Help:
Post by: AssassinRC on December 16, 2003, 11:58 PM
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.
Title: Re:PHP Help:
Post by: Banana fanna fo fanna on December 17, 2003, 06:06 PM
Quote from: Crazy_X on December 16, 2003, 10:42 AM
My fault, was in a hurry to get to school.
The % isn't on the line the so called "error" is on.
:-\


Doesn't say anything about the tags though.