Hello,
the user enters details into a form (values.php) whose action is (insert_values. php), where does the server-side validation code go?
(I know other posts on this subject say use PHP_SELF for the action but I don't want to redo all the code)
Where should I put the code? I tried it myself but neither way worked so probably the code is wrong for this but I know it works using the PHP_SELF method...
[php]
if (isset($_POST['submit']))
{
if(!$_POST['value1'] | !$_POST['value2'])
{
die('You did not fill in a required field.');
}
}
[/php]
any suggestions?
the user enters details into a form (values.php) whose action is (insert_values. php), where does the server-side validation code go?
(I know other posts on this subject say use PHP_SELF for the action but I don't want to redo all the code)
Where should I put the code? I tried it myself but neither way worked so probably the code is wrong for this but I know it works using the PHP_SELF method...
[php]
if (isset($_POST['submit']))
{
if(!$_POST['value1'] | !$_POST['value2'])
{
die('You did not fill in a required field.');
}
}
[/php]
any suggestions?
Comment