Faith-Hosting
06-19-2005, 09:49 PM
include_once("includes/session.include.php");
include_once("includes/mysql.include.php");
include_once("includes/functions.include.php");
switch($action){
case "login":
if(!isset($_SESSION['un']) && !isset($_SESSION['pw'])) {
$MEMBER = mysql_query("SELECT * FROM users WHERE un='$un'");
if(@mysql_num_rows($MEMBER)>0){
$MEMBER = mysql_fetch_array($MEMBER);
if($MEMBER[pw] == "$pw"){
session_register('un');
session_register('pw');
} else {
$ERROR = "<font size=\"1\" face=\"Verdana\"><b>Error</b>: The password you entered is incorrect. <a href=\"?\">Retry?</a></font>";
}
} else {
$ERROR = "<font size=\"1\" face=\"Verdana\"><b>Error</b>: Incorrect user. <a href=\"join.php\">Signup?</a> - <a href=\"?\">Retry?</a></font>";
}
}
break;
case "logout":
session_unset();
session_destroy();
break;
}
if(isset($_SESSION['un']) && isset($_SESSION['pw'])) {
$MEMBER2 = mysql_query("SELECT * FROM users WHERE un='$un'");
$MEMBER = mysql_fetch_array($MEMBER2);
if($MEMBER[pw] != $pw){
session_unset();
session_destroy();
}
}
Every time I run this code at www.rankmygame.com
or any other server it lag loads then crashes to a 404
If I remove this it works but when it crashes it never shows me why. Its like it loops then thinks the page isnt responding so it goes to a page could not be displayed...
Please please help...
Some BG Info
There is a session start file and a mysql db connect file...both these also work fine..I have other sites on my server which work fine but dont use this type of code to auth and start session...
Thank you...
include_once("includes/mysql.include.php");
include_once("includes/functions.include.php");
switch($action){
case "login":
if(!isset($_SESSION['un']) && !isset($_SESSION['pw'])) {
$MEMBER = mysql_query("SELECT * FROM users WHERE un='$un'");
if(@mysql_num_rows($MEMBER)>0){
$MEMBER = mysql_fetch_array($MEMBER);
if($MEMBER[pw] == "$pw"){
session_register('un');
session_register('pw');
} else {
$ERROR = "<font size=\"1\" face=\"Verdana\"><b>Error</b>: The password you entered is incorrect. <a href=\"?\">Retry?</a></font>";
}
} else {
$ERROR = "<font size=\"1\" face=\"Verdana\"><b>Error</b>: Incorrect user. <a href=\"join.php\">Signup?</a> - <a href=\"?\">Retry?</a></font>";
}
}
break;
case "logout":
session_unset();
session_destroy();
break;
}
if(isset($_SESSION['un']) && isset($_SESSION['pw'])) {
$MEMBER2 = mysql_query("SELECT * FROM users WHERE un='$un'");
$MEMBER = mysql_fetch_array($MEMBER2);
if($MEMBER[pw] != $pw){
session_unset();
session_destroy();
}
}
Every time I run this code at www.rankmygame.com
or any other server it lag loads then crashes to a 404
If I remove this it works but when it crashes it never shows me why. Its like it loops then thinks the page isnt responding so it goes to a page could not be displayed...
Please please help...
Some BG Info
There is a session start file and a mysql db connect file...both these also work fine..I have other sites on my server which work fine but dont use this type of code to auth and start session...
Thank you...
