Ok, I'm in the middle of writing my first script using sessions. Here's what I've got so far:
However, when I run the script I get all kinds of error messages like:PHP Code:<?php
$user = $_POST['username'];
$pass = $_POST['password'];
$db = mysql_connect("localhost") or die ("Couldn't connect to database");
mysql_select_db("test", $db) or die ("Couldn't select the database.");
$result = mysql_query("select * from details where username='$user' AND password='$pass'", $db);
$rowCheck = mysql_num_rows($result);
if($rowCheck > 0){
while($row = mysql_fetch_array($result)){
//start the session and register a variable
session_start();
//successful login code will go here...
echo 'Success!';
}
}
?>
They all seem to be do with the header information. Can anyone give me any hints on what I might be doing wrong?Warning: session_start(): open(/tmp\sess_c7f958a2fd528361fe4cbf743be3dc4f, O_RDWR) failed: No such file or directory (2) in c:\apache\apache\htdocs\sessions.php on line 16
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\apache\apache\htdocs\sessions.php:16) in c:\apache\apache\htdocs\sessions.php on line 16
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\apache\apache\htdocs\sessions.php:16) in c:\apache\apache\htdocs\sessions.php on line 16
Thanks alot




Bookmarks