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 1 of 1

Thread: Logout Button

  1. #1
    Join Date
    Dec 2007
    Location
    Toronto, Ontario, Canada
    Posts
    689
    Tokens
    0

    Default Logout Button

    I have a file called liindex.php - and at the bottom of all the content is my 'logout' button. At the moment, it isn't showing.

    PHP Code:
    <?php 
    include "config.php"
    if (
    $_GET ["action"] == "submit") { 
        
    $notes1 $_POST["notes"]; 
        
    mysql_query ("UPDATE notes SET notes='$notes1'"); 
        echo 
    "The notes have been succesfully edited.<br />"

    ?> 
    <form action="?action=submit" method="post"><textarea name="notes" 
        cols="40" rows="6"> 
    <?php 
    $sql 
    mysql_query "SELECT * FROM notes" ); 
    while ( 
    $fetch mysql_fetch_array $sql ) ) { 
        
    ?> <?php 
        
    echo $fetch["notes"]; 
        
    ?> 
     
    <?php 
    ?> 
    </textarea> <br /> 
    <input type="submit" value="Edit Notes" /></form> 

          <?php 
      
    include "config.php"
       
      if (
    $action == "liindex.php") { 
        if (
    $_SESSION ["session_username"] == "") { 
            echo 
    "You're not logged in."
            exit (); 
        } 
        echo 
    "<a href=\"login.php?action=logout\">Logout</a>"


    if (
    $action == "logout") { 
        if (
    $_SESSION ["session_username"]) { 
            
    session_unset (); 
            
    session_destroy (); 
            echo 
    "<meta http-equiv=\"refresh\" content=\"2;url=index.php\">";   
            exit (); 
        } else { 
            echo 
    "<meta http-equiv=\"refresh\" content=\"2;url=index.php\">";   
        } 
        } 
      
    ?>
    Thread moved from website design by --ss-- (Forum Super Moderator): Please post in the correct section .
    Last edited by --ss--; 02-02-2008 at 01:57 PM.

Posting Permissions

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