Hi
Please help me.
My password script doesn't work.
I have session problems, and have asked here before over the last days. But I can't figure it out.
So here is the entire code, as it looked before I upgraded to PHP 4.2.1
Now when I enter the correct user and password, I get rejected back to the login form, as if I was
enterring a wrong user or passsword.
As shown below, you can see that a sessionfile is created, but obviously not read.
Do You see the problem???
Any suggestions to what I can do or how to make another kind of authentification that works with PHP 4.2.1 or newer??
Sincerely
Kurt
-- THE LOGIN SCRIPT The user and pass comes from a form. --
<?
$user=$POST['user'];
$pass=$POST['pass'];
session_register("skfpass");
session_register("user");
$md5pass = md5($pass);
$conn = mysql_connect ("localhost", "kurt", "qrt");
mysql_select_db("skf-kfumdk");
$result = mysql_query("SELECT bruger, brugerpassword FROM brugere WHERE bruger='$user' AND brugerpassword='$md5pass'");
$num=mysql_numrows($result);
if($num=="1"){
$skfpass['let_in'] = "1";
header("Location: secret.php");
exit;
}
if ($num=="0"){
$skfpass['let_in'] = "0";
echo "<SCRIPT>alert(\"Unauthorized username or password. try again!\");history.go(-1)</SCRIPT>";
}
?>
-- THIS IS THE CONTENT OF SECRET.PHP --
<?
$skfpass[let_in]=$_GET['skfpass[let_in]'];
session_start();
if ($skfpass[let_in] != "1") {
Header("Location: loginform.php");
exit;
}
?>
<H2>Den hemmelige side</H2>
-- THIS IS THE SESSIONFILE --
skfpass|a:1:{s:6:"let_in";s:1:"1";}user|s:4:"kurt";