Hi all can you help I have a login script that looks at the details checks the database then fowards you to a secure area using sessions.
I would like to introduce cookies so that you could perhaps have a rememebr me feature and would log straight through to the members area.I have spent days reading up but I just do not understand the interaction of cookies or how to define them.
my code is simple but works
<?
include("inactivedelete.inc.php");
include("dbinfo.inc.php");
include("scripts/forumrank.inc.php");
mysql_connect("localhost",$username,$code);
mysql_select_db ("$database");
$pilot_id = $_POST['pilot_id'];
$password = $_POST['password'];
if((!$pilot_id) || (!$password)){}
$sql = mysql_query("SELECT * FROM members WHERE pilot_id='$pilot_id' AND password='$password'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
$_SESSION['pilot_id'] = $pilot_id;
$_SESSION['password'] = $password;
$meta='<meta http-equiv="refresh" content="0;url=http://www.flyukva.com/flyuk/pilotstatusimages/secure1.php?pilot_id='.$pilot_id.'">';
}
} else {
}
?>
basically it will do nothing if the data is wrong will redirect if right or if no data is added will do nothing.
any help here would be great as Im sick to death of entering the data every time, and have seen such things as forums where you are automatically remebered.
cheers in advance
Lee
and a merry christmas to all