Jump to content


Photo

Allways assinged to bad


  • Please log in to reply
1 reply to this topic

#1 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 27 April 2006 - 06:50 AM

Hi All

Can anyone please telll me why this is allways assigned to what ever is in the else statement (bad)and never assigns good even when i have a @ symbol in the text box that is to be posted.


if (strpos($_POST['email'], '@') !== false) {
$frm_check_email  = "good";
}
else {
$frm_check_email = "bad"; // why is this still = bad with @ symbol or without
$frm_check = "bad";
}

Thank you in Advance
Im loving it ........

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 April 2006 - 10:49 AM

I have tried the above code and it worked fine. If it isn't working for you then the $_POST['email'] is either not setup or you dont have a form field called email.

When you echo out $_POST['email'] does it return a value when you submit your form?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users