Compare domain name to db field
Posted: Sat Feb 27, 2010 2:19 pm
I want to chk the domain name against the db field on another site
I have it doing that but what I am having trouble with is that I cant get it to echo whether the script on the site is legit or illegal
my goal is to have it chk against my db to be sure they can use the script on that domain.
This is what I have so far
I thought that would work but its not anyone who can help would be nice.
I have it doing that but what I am having trouble with is that I cant get it to echo whether the script on the site is legit or illegal
my goal is to have it chk against my db to be sure they can use the script on that domain.
This is what I have so far
Code: Select all
preg_match("/[^.]*\.[^.]*$/", $_SERVER['HTTP_HOST'], $domain);
$r=mysql_query("Select * from lease WHERE domain='$domain'")or die(mysql_error());
while($info = mysql_fetch_array($r))
{
if($info['domain'] != $domain[0]) {
echo 'You are a theif';
} else {
echo 'OK!';
}
}