...

View Full Version : How to check field contents ??



jeddi
11-09-2012, 01:07 PM
Hi,

I am getting to much span in my contact form and want to
filter out any messages with a link in them.

I have written this code:


// Test for link in message.
if($Db_mess ) {
$err_msg = "Please do not use links in message."
require_once ("contact_fm.php");
exit;
} // endif


I would like to know what test I can use to find
this : [url=

This is always found in the spam messages.

Thanks for any help.

patryk
11-09-2012, 01:39 PM
take a look at preg_match()
http://php.net/manual/en/function.preg-match.php

jeddi
11-09-2012, 05:45 PM
So this should work then ...




if (preg_match("[url=", $Db_mess)) { // Test for link in message.
$err_msg = "Please do not use links in message."
require_once ("contact_fm.php");
exit;
} // endif


Thanks for the help.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum