I have a form that is receiving a user sign up (name, email, etc..). I get the value in the php file with $HTTP_POST_VARS
// Email from user $email = 'example@put2.net'; $banned_providers = array('put2.net', 'temporaryinbox.com'); if (in_array(strtolower(end(explode('@', $email))), $banned_providers)) { // throw error } PHP:
$temp = explode('@', $HTTP_POST_VARS[email]); if($temp[1] == 'put2.net') { not allowed code} else { welcome code } PHP:
So if I wanted it to check against the email submitted in the form, I would put this at the top: $email = $HTTP_POST_VARS ?
Thanks! This one guy has been spamming our sign ups with thousands of accounts per day. Our security prevents him from actually validating the accounts, so all it does is fill up our DB with crap. I tried some captcha but it didn't help for some reason, so hopefully this puts an end to it. Thanks!
Okay, I have the code, but it doesn't seem to be stopping this guy from signing up with the banned provider. This is at the top of my php file: Any ideas?
You can use the redirect, just make sure you use exit; or die(), so the actual script stops executing.