SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Loging Out Frozen Users!
-
May 2, 2002, 14:22 #1
- Join Date
- Mar 2002
- Location
- Florida
- Posts
- 37
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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>";
}
?>Last edited by Merlinsrealm; May 2, 2002 at 18:03.
-
May 2, 2002, 16:35 #2
- 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.
-ColinColin Anderson
Ambition is a poor excuse for those without
sense enough to be lazy.
-
May 2, 2002, 17:51 #3
- Join Date
- Mar 2002
- Location
- Florida
- Posts
- 37
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I have no clue what you just said.
Bookmarks