SuicidalDriver Posted August 29, 2013 Share Posted August 29, 2013 When using the below code, even with a valid email address (gmail) it returns invalid email, even my work address does not validate. What am I doing wrong? if(!filter_var($Email, FILTER_VALIDATE_EMAIL)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } Link to comment https://forums.phpfreaks.com/topic/281665-cannot-get-email-to-validate-correctly/ Share on other sites More sharing options...
AbraCadaver Posted August 29, 2013 Share Posted August 29, 2013 $Email is probably not what you think it is. echo $Email; Link to comment https://forums.phpfreaks.com/topic/281665-cannot-get-email-to-validate-correctly/#findComment-1447310 Share on other sites More sharing options...
SuicidalDriver Posted August 29, 2013 Author Share Posted August 29, 2013 I just checked an I was using the wrong vaiable, I have fixed that but still wont validate correctly if(!filter_var($$Email_from, FILTER_VALIDATE_EMAIL)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } Link to comment https://forums.phpfreaks.com/topic/281665-cannot-get-email-to-validate-correctly/#findComment-1447327 Share on other sites More sharing options...
PaulRyan Posted August 29, 2013 Share Posted August 29, 2013 Seriously though? Trolling or something? You have $$Email_from, should be $Email_from. Link to comment https://forums.phpfreaks.com/topic/281665-cannot-get-email-to-validate-correctly/#findComment-1447329 Share on other sites More sharing options...
AbraCadaver Posted August 29, 2013 Share Posted August 29, 2013 $$ Edit: Too slow. Link to comment https://forums.phpfreaks.com/topic/281665-cannot-get-email-to-validate-correctly/#findComment-1447330 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.