hi,
My login-form submits the username and password to the following php-file:
include("session_mysql.php");
session_start();
$link = mysql_connect("mysql.sourceforge.net", "bla", "blabla") or die(mysql_error());
mysql_select_db("bla") or die(mysql_error());
$name = $_POST['name'];
$passwd = $_POST['kennwort'];
$query = "SELECT * FROM user WHERE name = '".$name."'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
if(mysql_num_rows($result) <= 0) {
$redirect = "Location: http://bla.sourceforge.net/foo/login.php?msg=".urlencode("user not available");
}
elseif($row['passwort'] != $passwd) {
$redirect = "Location: http://bla.sourceforge.net/foo/login.php?msg=".urlencode("wrong password");
}
else {
$_SESSION['user'] = $name;
$_SESSION['perm'] = "true";
$redirect = "Location: http://bla.sourceforge.net/foo/game.php?mod=market";
}
mysql_free_result($result);
mysql_close($link);
session_write_close();
header($redirect);
header("Status: 303");
exit;
But testing this hack gives me just no output. I submit my login-form and I the login-form is loaded again, nothing else happens.
If i do echo $redirect; it's just nice, the string is always right.
Where's the reason for this problem?