Str_replace & php error
Posted: Mon Apr 12, 2010 12:31 pm
I am using 1 template for my whole site and the following code to check if a user is logged in if i remove the template and str_replace the code works it when i add it with that i get a problem can Any one tell me how to solve this please.
my code checks if a user is logged if yes displays logout if not displays Login.
" Parse error: syntax error, unexpected ';' in /home/Admin/public_html/index.php on line 45"<-- this the line were the code begins in my script
if i remove ":" I get a new error T if error.
if any one knows how to fix this much appreciated
my code checks if a user is logged if yes displays logout if not displays Login.
" Parse error: syntax error, unexpected ';' in /home/Admin/public_html/index.php on line 45"<-- this the line were the code begins in my script
if i remove ":" I get a new error T if error.
Code: Select all
$template= str_replace ("{_SIDE_URL1_}", session_start(); if(!session_is_registered(username))
{
echo 'href="http://www.mysite.com/Login.php" title="Login">Login';}else
{
echo ' href="http://www.mysite.com/logout.php" title="Logout">Logout</a>'; },$template);