How Can I Check This?
Posted: Tue Jul 07, 2009 6:28 pm
How can I check if the text inputted into a form matches the text I want (like a captcha).
Thanks in advance.
Thanks in advance.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
if $_POST['securityAnswer'] == qrjeyas
{
header ('Location: /login.html');
}
?>Code: Select all
<input name="securityAnswer" maxlength="12" onKeyUp="javascript: return inputLengthCheck(9);" width="300"></td>So if the user enters the correct password, you want to redirect to login.html??jasejunk wrote:Code: Select all
<?php if $_POST['securityAnswer'] == qrjeyas { header ('Location: /login.html'); } ?>
On your code shouldn't it be like this instead:jasejunk wrote:Yes indeed. But only if they enter that. If not, I want it to go to an error screen.
Thanks for your help btw.
Code: Select all
<input name="securityAnswer" maxlength="12" onKeyUp="javascript: return inputLengthCheck(9);" width="300" /></td>
And not
<input name="securityAnswer" maxlength="12" onKeyUp="javascript: return inputLengthCheck(9);" width="300"></td>Code: Select all
1. <?php
2. if $_POST['securityAnswer'] == qrjeyas
3. {
4. header ('Location: /login.html');
5. }
6. ?>
Should be
1. <?php
2. if $_POST['securityAnswer'] == qrjeyas
3. {
4. header ('Location: /login.html');
5. }
6. else
7. {
8. header('Location: /error.html');
9. }
10. ?>