code:
$ip = $_SERVER[REMOTE_ADDR];//Add this in your message
And then if its the spammers ip
code:
$spammers = array(
'IP 1',
'IP 2',
'IP 2'
);
for($i=0;$i<sizeof($spammers);$i++) {
if(strpos($ip, $spammers[$i])!==false) {
//Display you are a spammer and are not allowed to view this page
}
}