Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 3 of 3

Thread: Sessions

  1. #1
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default Sessions

    I'm kind of new with sessions, I'm trying to do a logout.php heres my code.
    PHP Code:
    <?php
    session_start
    ()

    $dbhost 'x';
    $dbuser 'x';
    $dbpass 'x';
    $dbname 'x';
    mysql_connect($dbhost$dbuser$dbpass) or die(mysql_error());

    mysql_select_db($dbname);

    $user $_SESSION['user'];

    mysql_query("UPDATE `users` SET `online` = '<img src=\"xxx.png\" border=\"0\" />' WHERE `user`='{$user}' ") or die(mysql_error());

     if(
    session_destroy()) {
     
     echo 
    "<meta http-equiv='refresh' content='0;url=xxx.php'>";
     } 
     else {
     echo 
    "Someting went wrong";
     }
     
    ?>
    Its giving me a blank page, but I was wondering do I need to unregister my session variables?
    How could this hapen to meeeeeeeeeeeeeee?lol.

  2. #2
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    unset($_SESSION["user"]); 
    Coming and going...
    Highers are getting the better of me

  3. #3
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    nevermind i i got it, i forgot a terminator on session_start(); thanks anyway +rep
    How could this hapen to meeeeeeeeeeeeeee?lol.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •