I have created a log in system and logging in is functioning but logging out is not working its showing error warnings.
logout.php
[PHP]
<?
//include function files for this application
require_once("s ystem_fns.php") ;
session_start() ;
$old_user = $valid_user; //store to test if *were* logged in
$result_unreg = session_unregis ter("valid_user ");
$result_dest = session_destroy ();
//start output html
do_html_header( "Logging Out");
if(!empty ($old user))
{
if($result_unre g && result_dest)
{
//if they were logged in and are now logged out
echo "Logged Out.<br>";
do_html_url("lo gin.php", "Login");
}
else
{
//they were logged in and could not be logged out
echo "Could not log you out.<br>";
}
}
else
{
//if they were logged in but came to this page somehow
echo "You were not logged in, and so you have been logged out.<br>";
do_html_url("lo gin.php", "Login");
}
?>
[/PHP]
This is the error I'm getting.
Parse error: parse error, unexpected T_STRING, expecting ')' in C:\project\test \logout.php on line 11
Here is code at line 11
[PHP]
if(!empty ($old user))
[/PHP]
Any is greatly appreciated.
logout.php
[PHP]
<?
//include function files for this application
require_once("s ystem_fns.php") ;
session_start() ;
$old_user = $valid_user; //store to test if *were* logged in
$result_unreg = session_unregis ter("valid_user ");
$result_dest = session_destroy ();
//start output html
do_html_header( "Logging Out");
if(!empty ($old user))
{
if($result_unre g && result_dest)
{
//if they were logged in and are now logged out
echo "Logged Out.<br>";
do_html_url("lo gin.php", "Login");
}
else
{
//they were logged in and could not be logged out
echo "Could not log you out.<br>";
}
}
else
{
//if they were logged in but came to this page somehow
echo "You were not logged in, and so you have been logged out.<br>";
do_html_url("lo gin.php", "Login");
}
?>
[/PHP]
This is the error I'm getting.
Parse error: parse error, unexpected T_STRING, expecting ')' in C:\project\test \logout.php on line 11
Here is code at line 11
[PHP]
if(!empty ($old user))
[/PHP]
Any is greatly appreciated.
Comment