unexpected T_STRING
Moderator: General Moderators
-
thoughtcriminal
- Forum Newbie
- Posts: 6
- Joined: Wed Feb 11, 2004 11:05 pm
unexpected T_STRING
i am trying to write a dating site and am using mod_rewrite so, faceparty/paul = faceparty/?page=profile.php&user=paul, but also want to have faceparty/introduction = faceparty/?page=introduction. i am currently using this code
<?php
$page = $_GET["page"];
$path="C:/Apache/htdocs/faceparty";
if(file_exists($path/$page)) {include "$page.php";}
else
{include "profile.php&user=$page;}
;?>
which is returning this error message:
Parse error: parse error, unexpected T_STRING in C:\Apache\htdocs\faceparty\index.php on line 29
line 29 being ";?>".
any ideas what went wrong? i'm sorry if i've left out something stupid, i've tried changing the slashes direction as it's on windows, it's 5 am, so i apologise in adance if i have done something stupid.
<?php
$page = $_GET["page"];
$path="C:/Apache/htdocs/faceparty";
if(file_exists($path/$page)) {include "$page.php";}
else
{include "profile.php&user=$page;}
;?>
which is returning this error message:
Parse error: parse error, unexpected T_STRING in C:\Apache\htdocs\faceparty\index.php on line 29
line 29 being ";?>".
any ideas what went wrong? i'm sorry if i've left out something stupid, i've tried changing the slashes direction as it's on windows, it's 5 am, so i apologise in adance if i have done something stupid.
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
try changing
to
You jsut forgot the last quote!!
Code: Select all
include "profile.php&user=$page;Code: Select all
include "profile.php&user=$page";-
thoughtcriminal
- Forum Newbie
- Posts: 6
- Joined: Wed Feb 11, 2004 11:05 pm
damn, i can't believe that! i'm such a gimboid! thanks.
now i'm getting...
Warning: Division by zero in C:\Apache\htdocs\faceparty\index.php on line 25
Warning: main(profile.php&user=poo): failed to open stream: No such file or directory in C:\Apache\htdocs\faceparty\index.php on line 27
Warning: main(): Failed opening 'profile.php&user=poo' for inclusion (include_path='.;c:\php4\pear') in C:\Apache\htdocs\faceparty\index.php on line 27
now i'm getting...
Warning: Division by zero in C:\Apache\htdocs\faceparty\index.php on line 25
Warning: main(profile.php&user=poo): failed to open stream: No such file or directory in C:\Apache\htdocs\faceparty\index.php on line 27
Warning: main(): Failed opening 'profile.php&user=poo' for inclusion (include_path='.;c:\php4\pear') in C:\Apache\htdocs\faceparty\index.php on line 27
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
thoughtcriminal
- Forum Newbie
- Posts: 6
- Joined: Wed Feb 11, 2004 11:05 pm
i tried that, and the response was the same as if i used:
<?php
$page = $_GET["page"];
if(file_exists($page.php)) {include "$page.php";}
else
{include "profile.php&user=$page";};
?>
which is, say if i went to faceparty/paul
Warning: main(profile.php&user=pauk): failed to open stream: No such file or directory in C:\Apache\htdocs\faceparty\index.php on line 26
Warning: main(): Failed opening 'profile.php&user=paul' for inclusion (include_path='.;c:\php4\pear') in C:\Apache\htdocs\faceparty\index.php on line 26
<?php
$page = $_GET["page"];
if(file_exists($page.php)) {include "$page.php";}
else
{include "profile.php&user=$page";};
?>
which is, say if i went to faceparty/paul
Warning: main(profile.php&user=pauk): failed to open stream: No such file or directory in C:\Apache\htdocs\faceparty\index.php on line 26
Warning: main(): Failed opening 'profile.php&user=paul' for inclusion (include_path='.;c:\php4\pear') in C:\Apache\htdocs\faceparty\index.php on line 26
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
thoughtcriminal
- Forum Newbie
- Posts: 6
- Joined: Wed Feb 11, 2004 11:05 pm
-
thoughtcriminal
- Forum Newbie
- Posts: 6
- Joined: Wed Feb 11, 2004 11:05 pm
ok, yeah, cool, thanks.
i changed profile.php accordingly, so it reads $page and changes it to $user.
the script seems to go straight to that party, it doesn't seem to find $page and automatically includes profile, i think maybe i shouyld be abl to work out the problem myself, thanks for your help though.
i changed profile.php accordingly, so it reads $page and changes it to $user.
the script seems to go straight to that party, it doesn't seem to find $page and automatically includes profile, i think maybe i shouyld be abl to work out the problem myself, thanks for your help though.
-
thoughtcriminal
- Forum Newbie
- Posts: 6
- Joined: Wed Feb 11, 2004 11:05 pm