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 />'; } Quote 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; Quote 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 />'; } Quote 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. Quote 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 (edited) $$ Edit: Too slow. Edited August 29, 2013 by AbraCadaver Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.