Need help with strpos()

For my site sign up, when I ask for their e-mail I use strpos(). More specifically, this.

[php]$at_sign = strpos(’$email’,’@’);
$dot = strpos(’$email’,’.’);

if($at_sign !== 1) {
header(‘Location: invalid-register.php’);
exit();
}

if($dot == 0) {
header(‘Location: invalid-register.php’);
exit();
}
[/php]

Whenever I sign up though it just ignores the @ and . that I put in the test email.

Any help? I tried changing $email to [email protected] in the strpos() to check if it’s that. I had the same problem…

should work now

[php]
if($at_sign !== true) {
header(‘Location: invalid-register.php’);
exit();
}

if($dot !== true) {
header(‘Location: invalid-register.php’);
exit();
}
[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service