I'm creating a website and I have implemented a commenting/review system on there but I want to stop spammers so I've been trying to find a way to stop people from typing in url's. I tried the following method but it only works for the last thing mentioned (.in) and ignores the rest, it also doesn't cover everything...
if(strstr($_POST["myreview"], 'www.')) {header("Location: page.php");}
if(strstr($_POST["myreview"], 'http')) {header("Location: page.php");}
if(strstr($_POST["myreview"], 'http://')) {header("Location: page.php");}
if(strstr($_POST["myreview"], '.com')) {header("Location: page.php");}
if(strstr($_POST["myreview"], '.co.uk')) {header("Location: page.php");}
if(strstr($_POST["myreview"], '.us')) {header("Location: page.php");}
if(strstr($_POST["myreview"], '.net')) {header("Location: page.php");}
if(strstr($_POST["myreview"], '.in')) {header("Location: page.php");}
else {
/*code to execute otherwise follows here*/
Can someone help?