Ok, I'm trying to create a normal login script. Here's my problem. It's giving me the following errors if I try to log in:
Warning: session_start(): open(C:\PHP\sessiondata\sess_93708bbcf75e3b96d372acd0bc3be757, O_RDWR) failed: Permission denied (13) in C:\Web\Plaid\login.php on line 21
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at C:\Web\Plaid\login.php:15) in C:\Web\Plaid\login.php on line 21
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Web\Plaid\login.php:15) in C:\Web\Plaid\login.php on line 21
Warning: Cannot modify header information - headers already sent by (output started at C:\Web\Plaid\login.php:15) in C:\Web\Plaid\login.php on line 25
Warning: Unknown(): open(C:\PHP\sessiondata\sess_93708bbcf75e3b96d372acd0bc3be757, O_RDWR) failed: Permission denied (13) in Unknown on line 0
Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\PHP\sessiondata) in Unknown on line 0
But it doesn't make sense because I've used this same login code countless times before and it's never failed me. My actual login script is below. Can you see what's wrong or maybe point me to a different login script that works better? (I'm sending the login through a different page than where the form sits.)
<?php
$user = $_POST['user'];
$pass = $_POST['pass'];
require("dbheader.php");
$person = mysql_query("SELECT userID FROM plaidusers WHERE username = '$user' AND password = MD5('$pass')");
if(mysql_num_rows($person) > 0)
{
$persons = mysql_fetch_array($person);
if($persons['approved'] == "no")
{
header("location: index.php?approved=no");
}
else
{
session_start();
$_SESSION['userid'] = $persons['userID'];
header("location: home.php?userid=$persons[userID]");
exit;
}
}
else
{
header("location: index.php?error=true");
}
?>