I want to store a php $_SESSION variable and retrieve it on another page.
Posted
by CDeanMartin
on Stack Overflow
See other posts from Stack Overflow
or by CDeanMartin
Published on 2010-06-16T09:31:54Z
Indexed on
2010/06/16
9:42 UTC
Read the original article
Hit count: 170
php
<?php
session_start();
// store session data
$_SESSION['count']=0; ?>
<html><head></head>
<body>
<?php include ("getElement.php");
echo getLinkButton("myscript.php", "myscript.php");
echo $_SESSION['count']++; ?>
</body>
</html>
The code above works, but when I click the link to navigate to myscript.php:
<?php
echo $_SESSION['count'];
?>
I get this error: Undefined variable: _SESSION in /home/ubuntu/public_html/myscript.php on line 2
© Stack Overflow or respective owner