SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Loging Out Frozen Users!

    OK, on my site when you get frozen you can still be logged in! this is a code that I wrote to log them out.
    PHP Code:
    <?php 
    $username 
    $_COOKIE['magic_pets_username'];
    mysql_connect("localhost""magicpet_Merlins""password")
            or die (
    "Could not connect: ".mysql_error());
    mysql_select_db("magicpet_net")
            or die (
    "Unable to select database: ".mysql_error());

    $selectfromuser mysql_query("SELECT active FROM user WHERE username = '$username'");
    $frozen mysql_fetch_array($selectfromuser);

    if(
    $frozen[0] == 1){
    setcookie("magic_pets_username","",time()+3600,"/","magicpets.net",0);
    setcookie("magic_pets_password","",time()+3600,"/","magicpets.net",0);

    echo 
    "<center><font color=red>This account has been frozen and you have been logged out!</font></center>";
    }
    ?>
    The error is, it doesn't say anyhting AT ALL!
    Last edited by Merlinsrealm; May 2, 2002 at 18:03.
    Merlinsrealm
    Magic Pets

  2. #2
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is the condition evaluating to true? If not, you're not going to receive anything unless you tell PHP to print something in the case that the condition is not met.

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have no clue what you just said.
    Merlinsrealm
    Magic Pets


Bookmarks

Posting Permissions

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