What's the problem with this code ?

Smolek

Diamond Member
Aug 30, 2001
4,985
1
0
I've got a file and it displays the following error when attempting to view it

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/name/public_html/folder/file.php on line 13
 

dighn

Lifer
Aug 12, 2001
22,820
4
81
header("Location: http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/account.php");

you are matching " with ', and ' with "
 

Smolek

Diamond Member
Aug 30, 2001
4,985
1
0
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/name/public_html/folder/file.php on line 13
 

dighn

Lifer
Aug 12, 2001
22,820
4
81
you didn't change it

instead of header("Location: http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/account.php");

use header('Location: http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/account.php');