How to compare between links
<p>This is very annoying to me, I'm trying to do simple ban tool system for urls that entered my website but still have problem of url compare.</p>

<p>I've created the following database table <code>badurl</code> with <code>url</code> i'm going to ban</p>

<pre><code>CREATE TABLE `badurl`(
`id` int(3) NOT NULL auto_increment,
`url` text,
PRIMARY KEY (`id`),
KEY `id` (`id`))
</code></pre>

<p>Now let say i've stored the following url <code>www.no_good_site.com</code>
and someone posted <code>http://www.no_good_site.com</code> however it is the same but it won't ban it.</p>

<pre><code>$user = "http://www.no_good_site.com" // visitor post this

// i'm gonna do compare by the stored banned urls
// I've stored this one www.no_good_site.com

$qry="select * from badurls where url='$user'";
$result=mysql_query($qry) or die($qry);
if(mysql_num_rows($result)=='0'){

echo "Good";

}else{

while($line=mysql_fetch_array($result)){

echo "Bad";

}}
</code></pre>

<p>so is there any idea i can set both (posted and stored url) without <code>www.</code> <code>http://</code> end slash <code>/</code> then compare it. [<code>no_good_site.com</code>]</p>

<p>cause it failed as they might enter with many possibilities and my way needs both to be exactly the same.</p>

<pre><code>no_good_site.com
no_good_site.com/
www.no_good_site.com/
http://no_good_site.com
http://no_good_site.com/
http://www.no_good_site.com
http://www.no_good_site.com/
</code></pre>

<p>oh very annoying so any help please ~ thanks</p>
