Bump this post as still need help XD
Bump this post as still need help XD
okay well i think your still needing the server bit this is only to show to it will or may not work.
Code:$server = $_GET[server]; $license = mysql_query("SELECT * FROM license WHERE server= '$server'"); $license = mysql_fetch_array($license); if($license == "0") { die('No license at this url.'); } elseif($license[stats] == "suspended") { die('Your license has been suspended.'); }
Thanks XDokay well i think your still needing the server bit this is only to show to it will or may not work.
Code:$server = $_GET[server]; $license = mysql_query("SELECT * FROM license WHERE server= '$server'"); $license = mysql_fetch_array($license); if($license == "0") { die('No license at this url.'); } elseif($license[stats] == "suspended") { die('Your license has been suspended.'); }
you can delete it now becasue ur making one yourself witch i plan to use when its out![]()
Well.... heres a little insight....
The Script
Your ServerPHP Code:<?php
$d = $_SERVER['HTTP_HOST']; //Get current domain
$d1 = str_replace('www.', '', $d); //Remove unwanted stuff
$domain = str_replace('w3.', '', $d1); //And removing more...
$result = mysql_query("SELECT license FROM settings"); //Get license
$row = mysql_fetch_array($result);
$license = $row['license'];
if($file = @file_get_contents("http://licensing.yoursite.com?d=$domain&l=$license")){
echo $file;
}else{
echo 'Could not connect to licensing server.';
?>
Don't use that exact code but its something to build onPHP Code:<?php
//Connect To Your License DB Here
$d = $_GET['domain'];
$l = $_GET['license'];
if($domain != ""&&$license != ""){
//Get Licenses From Your DB
$ls = mysql_query("SELECT * FROM licenses WHERE license = '$l'"); //Check db for license
$i = mysql_fetch_array($ls);
$count = mysql_query("SELECT COUNT(id) FROM licenses WHERE license = '$l'"); //Count instances found
$total = mysql_num_rows($count);
if($total == "1"&&$d = $i['domain']){ //What happens if the license is valid
echo 'Yay! Your license is valid.';
}else{ //What happens if it can't verify license
echo 'Could not validate license. Please contact us.';
echo '<meta http-equiv="refresh" content="2;url=http://licensing.yoursite.com/error.php">';
}
}
?>Hope it helps!
Note: The domains should be listed as "yoursite.com" not "www.yoursite.com" or "http://yoursite.com" for the above to work properly.
(Refer to code commenting for help as to what does what)
Last edited by QuickScriptz; 20-11-2007 at 12:40 AM. Reason: Added code comments
Thanks Scriptz +rep if i can XD and vistaboy
Want to hide these adverts? Register an account for free!