errors in session/cookie php source?
Posted: Thu Jun 17, 2004 8:19 am
hello,
I'm just learning how to work with sessions and cookies in PHP code and have run into some errors in my test code (can be viewed at
http://sardgr.dyndns.org/movie1.php and http://sardgr.dyndns.org/moviesite.php)
When I load movie1.php I get:
Warning: open(/tmp\sess_14cf1d5ee795fc7d155ca73281083d7d, O_RDWR) failed: No such file or directory (2) in C:\FoxServ\www\movie1.php on line 2
Click here to see information about my favorite movie!
Warning: open(/tmp\sess_14cf1d5ee795fc7d155ca73281083d7d, O_RDWR) failed: No such file or directory (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
When I load moviesite.php I get:
Warning: open(/tmp\sess_14cf1d5ee795fc7d155ca73281083d7d, O_RDWR) failed: No such file or directory (2) in C:\FoxServ\www\moviesite.php on line 2
Sorry, but you don't have permission to view this page!
Warning: open(/tmp\sess_14cf1d5ee795fc7d155ca73281083d7d, O_RDWR) failed: No such file or directory (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
source code for movie1.php
--------
<?php
session_start();
$_SESSION['username']="Joe12345";
$_SESSION['authuser']=1;
?>
<HTML>
<HEAD>
<TITLE>Find my Favorite Movie!</TITLE>
</HEAD>
<BODY>
<?php
$myfavmovie=urlencode("Life of Brian");
echo "<a href='http://sardgr.dyndns.org/moviesite.php? ... myfavmovie'>";
echo "Click here to see information about my favorite movie!";
echo "</a>";
?>
</BODY>
</HTML>
source code for moviesite.php
---------
<?php
session_start();
//check to see if user has logged in with a valid password
if ($_SESSION['authuser']!=1) {
echo "Sorry, but you don't have permission to view this page!";
exit();
}
?>
<HTML>
<HEAD>
<TITLE>My Movie Site - <?php echo $_REQUEST['favmovie'] ?></TITLE>
</HEAD>
<BODY>
<?php
echo "My favorite movie is ";
echo $_REQUEST['favmovie'];
echo "<br>";
$movierate=5;
echo "My movie rating for this movie is: ";
echo $movierate;
?>
</BODY>
</HTML>
thanks for any assistance!
I'm just learning how to work with sessions and cookies in PHP code and have run into some errors in my test code (can be viewed at
http://sardgr.dyndns.org/movie1.php and http://sardgr.dyndns.org/moviesite.php)
When I load movie1.php I get:
Warning: open(/tmp\sess_14cf1d5ee795fc7d155ca73281083d7d, O_RDWR) failed: No such file or directory (2) in C:\FoxServ\www\movie1.php on line 2
Click here to see information about my favorite movie!
Warning: open(/tmp\sess_14cf1d5ee795fc7d155ca73281083d7d, O_RDWR) failed: No such file or directory (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
When I load moviesite.php I get:
Warning: open(/tmp\sess_14cf1d5ee795fc7d155ca73281083d7d, O_RDWR) failed: No such file or directory (2) in C:\FoxServ\www\moviesite.php on line 2
Sorry, but you don't have permission to view this page!
Warning: open(/tmp\sess_14cf1d5ee795fc7d155ca73281083d7d, O_RDWR) failed: No such file or directory (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
source code for movie1.php
--------
<?php
session_start();
$_SESSION['username']="Joe12345";
$_SESSION['authuser']=1;
?>
<HTML>
<HEAD>
<TITLE>Find my Favorite Movie!</TITLE>
</HEAD>
<BODY>
<?php
$myfavmovie=urlencode("Life of Brian");
echo "<a href='http://sardgr.dyndns.org/moviesite.php? ... myfavmovie'>";
echo "Click here to see information about my favorite movie!";
echo "</a>";
?>
</BODY>
</HTML>
source code for moviesite.php
---------
<?php
session_start();
//check to see if user has logged in with a valid password
if ($_SESSION['authuser']!=1) {
echo "Sorry, but you don't have permission to view this page!";
exit();
}
?>
<HTML>
<HEAD>
<TITLE>My Movie Site - <?php echo $_REQUEST['favmovie'] ?></TITLE>
</HEAD>
<BODY>
<?php
echo "My favorite movie is ";
echo $_REQUEST['favmovie'];
echo "<br>";
$movierate=5;
echo "My movie rating for this movie is: ";
echo $movierate;
?>
</BODY>
</HTML>
thanks for any assistance!