I am new to PHP session. I tired this HTML form :
Code: Select all
<FORM METHOD="POST" ACTION="page2.php">
Enter your Name: <input type="text" name="name">
<input type="SUBMIT" value="Submit">
</FORM>Code: Select all
<?php
<?php
// start the session
session_start();
header("Cache-control: private"); //IE 6 Fix
echo "<strong>Step 2 - Register Session </strong><br />";
// Get the user's input from the form
$name = $_POST['name'];
// Register session key with the value
$_SESSION['name'] = $name;
// Display the sssion information:
?>
Welcome to my website <strong><? echo $_SESSION['name']; ?></strong>!<br />
Let's see what happens on the <a href="page3.php">next page.</a><br /><br />
?>Code: Select all
Warning: session_start(): open(/tmp\sess_f5f742223c39d689a5800a94129e8787, O_RDWR) failed: No such file or directory (2) in c:\program files\apache group\apache\htdocs\page2.php on line 3
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\program files\apache group\apache\htdocs\page2.php:3) in c:\program files\apache group\apache\htdocs\page2.php on line 3
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\program files\apache group\apache\htdocs\page2.php:3) in c:\program files\apache group\apache\htdocs\page2.php on line 3
Warning: Cannot modify header information - headers already sent by (output started at c:\program files\apache group\apache\htdocs\page2.php:3) in c:\program files\apache group\apache\htdocs\page2.php on line 4
Step 2 - Register Session
Welcome to my website crazy !
Let's see what happens on the next page.
Warning: Unknown(): open(/tmp\sess_f5f742223c39d689a5800a94129e8787, O_RDWR) failed: No such file or directory (2) 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 (/tmp) in Unknown on line 0Can anybody pin point the problem? it seems that the script is correct. To work with session do I have to make any changes in the configuration file or something similar?
Many thanks in advance..