php sessions
Posted: Fri Nov 21, 2008 7:28 pm
Hello I'm having a little problem with php sessions. I'm trying to test the code below and wants to print the value after submit the form. http://abetterc.ipower.com/sessionTest1.php
This is my codes:
sessionTest1.php
sessionTest2.php
The problem is that the session_var is not appearing. How to correct my code? Any advice will appreciated very much.
Thanks,
Vick
This is my codes:
sessionTest1.php
Code: Select all
<?php
session_save_path(home/users/web/b1631/ipw.abetterc/public_html/cgi-bin/tmp);
session_start();
?>
<html>
<head><title>Testing Sessions page 1</title></head>
<body>
<?php
$_SESSION['session_var'] = "testing";
echo "This is a test of the sessions feature.
<form action='sessionTest2.php' method='POST'>
<input type='hidden'
name='form_var' value='testing'>
<input type='submit' value='go to next page'>
</form>";
?>
</body></html>Code: Select all
<?php
session_save_path(home/users/web/b1631/ipw.abetterc/public_html/cgi-bin/tmp);
session_start();
?>
<html>
<head><title>Testing Sessions page 2</title></head>
<body>
<?php
echo "session_var = {$_SESSION['session_var']}<br>\n";
echo "form_var = {$_POST['form_var']}<br>\n";
?>
</body></html>Thanks,
Vick