Re: Form validation issue
| From: | kranthi | Date: | Thu, 24 Dec 2009 09:40:41 +0000 |
| Subject: | Re: Form validation issue | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300664@lists.php.net to get a copy of this message | ||
The javascript function formValidator() must return false if any
errors are formed.
>>The PHP only runs if the fields are set by testing using ‘isset”.
You should definitely have a better validation than that. Remember
that all users dont have javascript enabled. Moreover it is very easy
to modify the request variables.
>> However, if the server-side evaluation fails and the page is refreshed, then all the
>> previous values are lost -- UNLESS -- you keep them in a cookie, database, or session. I suggest
>> using a session.
This is true when the page is refreshed but I doubt that is the case
here. Since $_SERVER['PHP_SELF'] is being used I think value="<?php
echo $_POST[...] ?>" will be sufficient