...

View Full Version : session trouble



ruby
01-20-2003, 04:51 PM
(form name = "form", textbox = "text")

if i want to get the data from "text" after submitted the "form"
then, how can i save the data into a session??

and how to call the session in another page , can u show me??

bored
01-20-2003, 07:06 PM
When you have a form posting to a PHP script, the values in the form itself are set as variables on the posted page. I'm not sure this is what you want to know, but say you post with the field "text". Now, on the posted script you can manipulate the variable $text seeing is that was the name of the form field in the previous page.

Sessions are a different story as far as storing data. You might want to read up on the PHP manual about that.

http://www.php.net/manual/en/ref.session.php

mordred
01-20-2003, 08:12 PM
Originally posted by bored
I'm not sure this is what you want to know, but say you post with the field "text". Now, on the posted script you can manipulate the variable $text seeing is that was the name of the form field in the previous page.

But only if the php.ini setting register_globals is set to "On". And that's no longer the case in the default php.ini distributed with PHP's 4.1 (and higher) version. Better use $_POST['text'] to get at the posted values.

bored
01-20-2003, 10:26 PM
True. I've never had a host that left them off. But for security's sake, that is better.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum