Ken wrote:
> Basic session variable.
> This does not work.
> The session name and ID are the same on each page.
> In php.ini: register_globals = On
>
> Session variable test11 does not transfer to test12.php
> What am I doing wrong? Thanks for the help.
You never assugned the $_POST['test11'] to a session variable...
> TEST11.PHP
> <?php
> session_start();
> echo "<br><br>".session_name()." = ".session_id();
> echo "<center><b>T E S T 11 ---</b></center><br>";
> ?>
> <html><body>
> <form name="form1" method="post" action="test12.php">
> <input type="hidden" name="test11" value='Hidden - Test11'>
> <center><input type="submit" value="test11"></center>
> </form></body></html>
>
> TEST12.PHP
> <?php
> session_start();
// of course you should validate that
// $_POST['test11'] is the type of
// data that you expect first...
$_SESSION['test11']=$_POST['test11'];
> echo "<br><br>".session_name()." = ".session_id()."<br><br>";
> echo "<center><b>T E S T 12 </center><br>";
> echo "Session variable ( hidden - test11 ) =
> ".$_SESSION['test11']."<br><br>";
> ?>
> <html><body>
>
> <form name="payment" method=post action="test11.php">
> <center><input type="submit" value="test12"></center>
>
> </form></body></html>
HTH
--
Justin Koivisto - spam.TakeThisOut@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
SEO Competition League: <a style='text-decoration: underline;' href="http://seo.koivi.com/" target="_blank">http://seo.koivi.com/</a><!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Session variables