Posted by Marcel Schindler on 10/07/14 11:35
Todd schrieb:
> Merry Christmas everyone!. I'm relatively new to PHP and I'm looking
> for way to ensure text boxes are filled and radio button are selected
> before running my PHP script. All info from the HTML controls will
> have to be passed on to the PHP script as variables. I have tried a
> few techniques such as javascript to no avail. Anyone have any
> thoughts?
>
As PHP runs on the server while the form is on the client, there is just
the solution that you use javascript to check if fields are filled
(document.form[0].element[0].value...) but that is quite insecure,
because the user can deactivate Javascript. The other solution is to
check each $_GET or $_POST-element (which you should always do) and
redirect the user back to the form (populated with those values which
were okay)
Best regards,
Marcel Schindler
--
http://www.trancefish.de/
http://www.skaletracker.de/
http://www.phpfreak.de/
Navigation:
[Reply to this message]
|