note 21333 deleted from language.variables.predefined by philip
| From: | philip@php.net | Date: | Sun, 08 Dec 2002 02:23:28 +0000 |
| Subject: | note 21333 deleted from language.variables.predefined by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40506@lists.php.net to get a copy of this message | ||
Just a quick note incase anyone comes across the same problem.
Basic problem results from the new superglobals and having globals set to off: basic form that shows
a record from database, on submit updates the record.
The problem comes with validating the data, i.e. user enteres a non suitable value and you throw
back the form and the error.
When you pull the data from the database, the values are not in the $_POST or $_GET super globals,
thus using $_POST[var] as initial value for form field doesnt work.
Using $some_var as initial is fine, but if the user enteres an improper value, those values wont be
available because they are then in $_POST or $_GET.
The solution is simple, but it escaped me for a bit because I didnt think it would be possible: you
can actually defined $_POST members within a script, thus your values from the database should be
converted to $_POST or $_GET members.
Hope it helps someone.