i'm making a login script for my page, it doesn't need to be very secure so i'm jsut using cookies and such i'm not even using MD5() for the passwords
this is what my script looks like, now my question is, is there a way to make it so that the user doesn't have to refresh the page to actually login? test it out to see what i mean
<?
$logout = @$HTTP_GET_VARS['logout'];
if($logout) {
setcookie ("vertigo1", "",time()-3600);
setcookie ("vertigo2", "",time()-3600);
setcookie ("vertigo3", "",time()-3600);
setcookie ("vertigo4", "",time()-3600);
};
$Login = @$HTTP_POST_VARS["Login"];
If ($Login) {
$Usr = @$HTTP_POST_VARS["Usr"];
$pass = @$HTTP_POST_VARS["pass"];
@$conn = mysql_connect(HOST, USER, PASS);
mysql_select_db(DB);
$strsql = "SELECT Uname,Pword,id FROM `users` WHERE `Uname` = '$Usr'";
$rs = mysql_query($strsql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($rs);
$x_id = $row["id"];
$x_Uname = $row["Uname"];
$x_Pword = $row["Pword"];
if($x_Pword==$pass) {
setcookie ("vertigo1", $x_Uname,time()+3600);
setcookie ("vertigo2", $x_Pword,time()+3600);
setcookie ("vertigo3", $x_id,time()+3600);
setcookie ("vertigo4", "1",time()+3600);
};
mysql_free_result($rs);
};
include "userstatus.inc.php";
if(@$vertigo4) {
loggedin();
} else {
notlogged();
}; ?>
if you want to test it out, you can go here, mouse over the user menu at the top to get the login box
http://www.vertigolabs.org
username: test
password: test