session_start
| From: | John Taylor-Johnston | Date: | Sat, 14 Dec 2002 09:15:01 +0000 |
| Subject: | session_start | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-128278@lists.php.net to get a copy of this message | ||
I used to think I knew how to do this ... take pity :)
I start my session:
session_name("TestALS");
session_start();
I register a variable:
session_register("studentid");
if (isset($_SESSION["studentid"]))
{
$id = $_SESSION["studentid"];
echo "\$studentid= $studentid<br>";
}
Pretend $studentid contains something from a previous form.
Here is my form with nothing else other than a submit button. But the variable does not get passed
unless I add a field. Where did I go wrong? Geez, I know I don't have to repeat a whole bunch
of <input type=hidden name=studentid>. That is what a session is for.
<form action=this.php>
<input type=submit>
</form>
Should I pass the session id? How? Why does my variable "studentid" NOT get passed after I
click submit. Where did I f*** up?
Like I said, take pity. I have been reading the FAQ: http://www.php.net/manual/en/ref.session.php
And like I also said, I thought I knew how to do this :)
John