note 20040 added to ref.session
| From: | noah dot andreas at na-it dot de | Date: | Wed, 20 Mar 2002 13:24:12 +0000 |
| Subject: | note 20040 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27987@lists.php.net to get a copy of this message | ||
If u try to save values from a form in session_vars its important that the name of the session_var
is different from the name of the formfield. if its the same, u ll get some *** errors and u spend
hours for searchin ur mistake ;-)
extremly simplified:
##file1.php:
<form .... target="file2.php">
<input .... name="fhugo">
</form>
##file2.php:
<? session_start();
session_register('hugo');
# save value of formfield in sessionvar
#remove everything from $hugo, only a-z and A-Z is allowed
$hugo = ereg_replace("[^a-zA-Z]","",$fhugo);
# go to next page
header("Location: file3.php");
?>
## file3.php:
<? session_start();
echo "hugo is $hugo";
?>
<a href="file1.php">start again</href>
i use this for savin some options for a database search that uses several forms and scripts
--
http://www.php.net/manual/en/ref.session.php
http://master.php.net/manage/user-notes.php?action=edit+20040
http://master.php.net/manage/user-notes.php?action=delete+20040
http://master.php.net/manage/user-notes.php?action=reject+20040