note 20040 deleted from ref.session by sniper
| From: | sniper@php.net | Date: | Tue, 21 Jan 2003 03:21:35 +0000 |
| Subject: | note 20040 deleted from ref.session by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-42486@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