| 
	
 | 
 Posted by Schraalhans Keukenmeester on 05/29/07 05:29 
At Tue, 29 May 2007 07:27:06 +0200, Schraalhans Keukenmeester let h(is|er) 
monkeys type: 
 
> At Mon, 28 May 2007 18:22:11 -0700, hmlarson let h(is|er) monkeys type: 
>  
>> hello, 
>>  
>> i am trying to validate a form field ... requiring the user to enter 1 
>> of 2 possible security codes (for example 1000 or 9975). 
>>  
>> this part of my code does not seem to working - it gives the error 
>> message when I enter the correct security code(s). 
>>  
>> 	if ($_POST['security_question'] != 1000 || 9975) { 
>> 	$errors[]= 'You have entered an incorrect security code.'; 
>> } 
>>  
>> any tips on handle this?  i am somewhat new to php - any info is much 
>> appreciated.  thanks 
>  
> Your code : 
>  
> if ($_POST['security_question'] != 1000 || 9975) 
>  
> should be something like: 
>  
> if (($_POST['security_question'] != 1000) && 
>     ($_POST['security_question'] != 1000)) { 
>     [...] 
> } 
 
Oops, typo. 
 
 if (($_POST['security_question'] != 1000) && 
     ($_POST['security_question'] != 9975)) { 
     [...] 
 } 
 
Sorry. 
 
Sh.
 
[Back to original message] 
 |