|
Posted by Allodoxaphobia on 01/23/07 18:22
On Tue, 23 Jan 2007 17:38:52 +0100, Veco wrote:
> Hi guys! (and girls if any ;)
>
> I want to block my users from submitting a string that includes link(s)
> stated using a href=...
>
> probably there's some function in php?
>
> i don't want eregi_replace, I just want the code to check a string in
> variable if there's any a href... if so, then I'll use exit(); or smthng
> else
A function I wrote to sit in a message board program I wrote:
function check_bad_content($string)
{
// Stuff that spammers post with:
$bad_strings = array('www.','/url]','ttp://','ttps://') ;
foreach( $bad_strings as $bad_string )
{
if ( ereg( $bad_string, $string ) ) return false ;
}
return true;
} // E-O-function check_bad_content
The entire message is passed in the parameter to check_bad_content.
HTH
Jonesy
--
Marvin L Jones | jonz | W3DHJ | linux
38.24N 104.55W | @ config.com | Jonesy | OS/2
*** Killfiling google posts: <http://jonz.net/ng.htm>
Navigation:
[Reply to this message]
|