Apparently this thing crashed a server 6 times and got two of my hosting accounts deleted. So, I asked the host owner person to help me make it so it can work on a shared server. I have no clue how to do so. Can someone help me?
This is the licensing thing that lets a script to connect back.
PHP:
<?php
require ("/home/joe/FileLibrary/configuration.inc.php");
$lang['license_key_notfound'] = 'The key you have entered was not found.';
$lang['license_invalid_domain'] = 'The domain in which the script is hosted on is invalid.';
$lang['license_invalid_ip'] = 'The server IP address is not allowed to execute this script.';
$lang['license_expired'] = 'The license in use for this script has expired.';
$domain = $db->protect($_GET['domain']);
$ip = $db->protect($_GET['ip']);
$key = $db->protect($_GET['key']);
$getQuery = $db->dbQuery("SELECT * FROM `" . DB_PREFIX .
"licenses` WHERE `key` = '$key';");
switch ($_GET['act']) {
default:
case 'verify_license':
if ($db->dbCount($getQuery) == 0) {
die($lang['license_key_notfound']);
} else {
$arrData = $db->dbFetch($getQuery);
$domainArr = explode(",", $arrData->allowed_domains);
$ipArr = explode(",", $arrData->allowed_ips);
if ((!in_array($domain, $domainArr) && $arrData->allowed_domains != '*')) {
die($lang['license_invalid_domain']);
} else {
if ((!in_array($ip, $ipArr) && $arrData->allowed_ips != '*') || (!is_array($ipArr) &&
$arrData->allowed_ips != '*')) {
die($lang['license_invalid_ip']);
} else {
if ($arrData->expirey_date < date("Ymd") && $arrData->expirey_date != 'never') {
die($lang['license_expired']);
}else{
die("Okay!");
}
}
}
}
break;
case 'script_info':
if ($db->dbCount($getQuery) == 0) {
die($lang['license_key_notfound']);
} else {
$arrData = $db->dbFetch($getQuery);
$domainArr = explode(",", $arrData->allowed_domains);
$ipArr = explode(",", $arrData->allowed_ips);
if ((!in_array($domain, $domainArr) && $arrData->allowed_domains != '*')) {
die($lang['license_invalid_domain']);
} else {
if ((!in_array($ip, $ipArr) && $arrData->allowed_ips != '*') || (!is_array($ipArr) &&
$arrData->allowed_ips != '*')) {
die($lang['license_invalid_ip']);
} else {
if ($arrData->expirey_date < date("Ymd") && $arrData->expirey_date != 'never') {
die($lang['license_expired']);
}else{
if ($arrData->show_info == 1) {
die("yes");
}else{
die("no");
}
}
}
}
}
break;
case 'license_info':
if ($db->dbCount($getQuery) == 0) {
die($lang['license_key_notfound']);
} else {
$arrData = $db->dbFetch($getQuery);
$domainArr = explode(",", $arrData->allowed_domains);
$ipArr = explode(",", $arrData->allowed_ips);
if ((!in_array($domain, $domainArr) && $arrData->allowed_domains != '*')) {
die($lang['license_invalid_domain']);
} else {
if ((!in_array($ip, $ipArr) && $arrData->allowed_ips != '*') || (!is_array($ipArr) &&
$arrData->allowed_ips != '*')) {
die($lang['license_invalid_ip']);
} else {
if ($arrData->expirey_date < date("Ymd") && $arrData->expirey_date != 'never') {
die($lang['license_expired']);
}else{
die("Script created by ".$arrData->script_author." at <a href=\"".$arrData->script_com_link."\">".$arrData->script_company."</a>");
}
}
}
}
break;
}
?>
This is the licensing thing that lets a script to connect back.
PHP:
<?php
define("LICENSE_KEY","4T7P-M1U-9B1-717F");
function get_license($action = null)
{
$url = "http://licensing.codingdev.net/serv.php?act=$action&key=".LICENSE_KEY."&domain=".$_SERVER['HTTP_HOST']."&ip=".$_SERVER['SERVER_ADDR'];
$options = array(
CURLOPT_USERAGENT => $domain . "(" . $ip . ") LICENSE CHECK",
CURLOPT_CONNECTTIMEOUT => 60,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_TIMEOUT => 60,
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}
#Get general license information
$license_check = get_license('verify_license');
switch($license_check)
{
default:
die($license_check);
break;
case 'Okay!':
//Do Nothing
break;
}
print "Hello World!";
$info_check = get_license("script_info");
if($info_check == 'yes'){
$license_info = get_license('license_info');
print "<br /><br /><code>".$license_info."</code>";
}
?>
Last edited: