Re: link counting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/6/07, Sebe <sebastian@xxxxxxxx> wrote:
i thought of an idea of counting the number of links to reduce comment spam.

unfortunately my methods is not reliable, i haven't tested it yet
though.. anyone have maybe a better solution using some regexp?

$links = array('http://', 'https://', 'www.');

$total_links = 0;
foreach($links as $link)
{
    $total_links = substr_count($string, $link);
}

if($total_links > X)
{
   .....
}


I don't have a better way, but links starting with http://www. or
https://www. are counted twice in your script...

Tijnema
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux