Hello phpbuilders!
I was wondering how I would do this.. I am making a site where users can submit things off their sites, to make a long story short, I would like to ban certain sites from being able to submit.
There is a URL field on the submission page, so when they enter certain wildcard names in the URL field, I would like it to display "your site has been banned".
Say I banned google.com, how could I make it so it still said they were banned if they put in http://www.google.com, or www.google.com/blahblahblah?
This is the basic layout of my query:
$query = mysql_query("SELECT * FROM sitebans WHERE url LIKE '%$surl%'");
$myNum = mysql_num_rows($query);
if ($myNum > 0) {
die("Your site is banned!");
}
$surl is the sites URL coming from the submission form. This does not work though, because if I ban google.com, and they put in www.google.com, it will do this...
SELECT * FROM sitebans WHERE url LIKE www.google.com
and since I banned "google.com" it will return no rows..
Please help me with this, I really need to get this working 🙁
Thanks!