My first question is this:
Say I have a form like below in a file called form.php..
- Code: Select all
<FORM ACTION="<?php echo($form_result); ?>" METHOD="post">
Your name: <input type="text" name="fdbk_name" maxlength="40" /><br />
Your company: <input type="text" name="fdbk_company" maxlength="40" /><br />
Your email address: <input type="text" name="fdbk_email" maxlength="40" /><br />
<INPUT TYPE="SUBMIT" NAME="submiterror" VALUE="SUBMIT">
</FORM>
At the top of the page I called:
- Code: Select all
$form_result = feedbackform.php
I've read that you need to make sure that all variables need to be validated before use. So does that mean that I can't even submit the form to another page (feedbackform.php) where it is immediately validated? Do I need to do validation within form.php before going onto feedbackform.php....where I have to validate it again?
If I have to do it within itself, would this work:
$form_result = htmlspecialchars($_SERVER['PHP_SELF']);
.....but then how do I send it onto another php page if validation succeeds?
Thanks for your help!


