Heres the code:
Code: Select all
<?php
$_POST['username'] = addslashes($_POST['username']);
$_POST['password'] = addslashes($_POST['password']);
session_start();
$link = mysql_connect("localhost", "Drachlen", "*")
or die("Could not connect");
mysql_select_db("game", $link) or die("Could not select database");
$query = mysql_query("select username from test where username="$username" and password="$password" limit 1");
if (mysql_num_rows($query) == '1') {
$_SESSION['auth'] = true;
$_SESSION['username'] = $_POST['username'];
echo "You have logged in.";
} else {
$_SESSION['auth'] = false;
$_SESSION['username'] = '';
echo "Incorrect username or password.";
}
?>Warning: open(/tmp\sess_5890a67e5f0aaa4b24910dfb25e547cc, O_RDWR) failed: m (2) in C:\apache\htdocs\my\verify.php on line 4
You have logged in.
Warning: open(/tmp\sess_5890a67e5f0aaa4b24910dfb25e547cc, O_RDWR) failed: m (2) in Unknown on line 0
Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
I know its logging in correctly, but theres somethin wrong with the session..