I have this code for testing my session in php.The problem is with the session start where after i run it it display
"Warning: open(/tmp\sess_e63375b45ea35d2ec4c24ecd7e8ded12, O_RDWR) failed: m (2) in c:\webroot\session.php on line 2"
and the pagecount doesn't seem to increse.
Is it something to do with the configuration.
What should be done.
Please advise since i'm new to php.
thanks.
<?php
session_start();
session_register('pagecount');
session_register('username');
if (IsSet($pagecount))
$pagecount++;
else
$pagecount = 1;
$pagecount_limit = 5;
?>
<HEAD><TITLE>Session testing page</TITLE>
</HEAD><BODY>
<H3>Session testing</H3>
Your session ID is <?php print(session_id());?><BR>
There might be any number of other session IDs, but
this one is yours.
<P>Don't bother writing your session ID down.<BR>
It's really a behind-the-scenes kind of thing.<BR>
PHP needs to know it but you probably don't.<BR>
<?php
if (IsSet($posted_username))
$username = $posted_username;
if (IsSet($username))
{
print("<P>We know your name! It's $username<BR>");
}
?>
<P>You have visited <?php print($pagecount);?>
page(s) this session.<BR>
<?php if ($pagecount == 1)
print("You must have just arrived!<BR>"); ?>
You are only allowed <?php print($pagecount_limit);?>
pages per session.<BR>
<P>This is a link to
<A HREF="<?php echo $PHP_SELF;?>">this very page</A>.<BR>
Following it will increase the number of pages<BR>
you have visited in your session, but won't do much else.
<P>Here is a form you can use to tell us
your name if you feel like it.<BR>
We won't sell it to anyone.<BR>
<P><FORM METHOD=POST ACTION="<?php echo $PHP_SELF;?>" >
My name is:
<INPUT TYPE=TEXT SIZE=20 NAME=posted_username><BR>
<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE="Remember me!">
</FORM>
</BODY>
<?php
if ($pagecount >= $pagecount_limit)
session_destroy();
?>