logout script not functioning

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muchexie
    New Member
    • Feb 2007
    • 20

    #1

    logout script not functioning

    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.
  • aniltc
    New Member
    • Jul 2006
    • 17

    #2
    Originally posted by muchexie
    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.
    check this page
    [PHP] do_html_header( "Logging Out");[/PHP]
    i am not able to see any extensions here

    Comment

    • muchexie
      New Member
      • Feb 2007
      • 20

      #3
      Originally posted by aniltc
      check this page
      [PHP] do_html_header( "Logging Out");[/PHP]
      i am not able to see any extensions here
      Maybe I did not get your question right but the way I understand this code.
      [PHP]
      do_html_header( "Logging Out");
      [/PHP]
      It only outputs the statement Logging Out.I don't think it should have the extensions you are talking about.

      Comment

      Working...