So, are there any coding specialists out there who know the way to merge the code below with the code WHMCS has?
I love this code, personally, as it checks it directly from the box and then provides the choice to the user to buy the domain/hosting without taking you directly to the WHMCS until you click "get" or something like that.
Ideas?
<?php
/***************************Configure here***********************************/
//////////////////////////////////////////////////////////////////////////////
///////Usage: Just configure and place this file anywhere in a webserver//////
//////////////////////////////////////////////////////////////////////////////
$ALP_URL = 'http://www.yoursitehere.com/hosting/';
$LIST_OF_TLDS = array('com','net','org','biz','info','cc','us','tv');
$FORCE_ONLY_DOMAIN = false;
$lang = array();
$lang['available'] = "<font color=\\'blue\\'>Domain is available for registration.</font>";
$lang["invalid"] = "<font color=\\'red\\'>Domain is invalid.</font>";
$lang["notavailable"] = "<font color=\\'red\\'>Domain is not available.</font>";
$lang["Check"] = "Check Domain";
$lang["Please_wait"] = "Checking, Please wait...";
$lang['Continue'] = "Continue...";
$lang['Domain'] = "Domain : ";
$lang['Quering'] = "Checking the whois servers...";
$lang['only_domain'] = "Register domain only";
$lang['with_hosting'] = "New domain with hosting";
//////////////////////////////////////////////////////////////////////////////
////////////////////////No need to edit below this line///////////////////////
//////////////////////////////////////////////////////////////////////////////
/****************************************************************************/
?>
<script type="text/javascript" language="javascript">
<!--
var http_request = false;
function makeRequest(u) {
url = '<?php echo $ALP_URL; ?>info.php?'+u;
http_request = false;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = makeSelect;
http_request.open('GET', url, true);
http_request.send(null);
}
function makeSelect() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
s = Trim(http_request.responseText);
if(s=='1')
{
getObj('btn').value = '<?php echo $lang['Continue']; ?>';
document.getElementById('whoisresult').innerHTML = '<?php echo $lang['available']; ?>';
}
else if(s=='-1')
{
getObj('btn').value = '<?php echo $lang['Check']; ?>';
document.getElementById('whoisresult').innerHTML = '<?php echo $lang['invalid']; ?>';
}
else
{
getObj('btn').value = '<?php echo $lang['Check']; ?>';
document.getElementById('whoisresult').innerHTML = '<?php echo $lang['notavailable']; ?>';
}
} else {
alert('There was a problem with the request.');
getObj('btn').value = '<?php echo $lang['Check']; ?>';
}
}
else if(http_request.readyState != 0)
{
document.getElementById('whoisresult').innerHTML = '<?php echo $lang['Quering']; ?>';
getObj('btn').value = '<?php echo $lang['Please_wait']; ?>';
}
}
function getObj(objname)
{
form = document.getElementById('domainCheck');
for(i=0; i<form.length; i++)
{
if(form[i].name==objname)
return form[i];
}
return null;
}
function tocart() {
var EXT;
var SLD;
var CAT
EXT = getObj('ext').value;
SLD = getObj('sld').value;
<?php if(!$FORCE_ONLY_DOMAIN) { ?>
CAT = getObj('cat').options[getObj('cat').selectedIndex].value;
<?php } else { ?>
CAT = 0;
<?php } ?>
if(CAT == 0)
var loc=("<?php echo $ALP_URL; ?>index.php?category=0&tld=" + EXT + "&sld=" + SLD);
else
var loc=("<?php echo $ALP_URL; ?>index.php?tld=" + EXT + "&sld=" + SLD);
this.location.href = loc;
}
function Trim(STRING){
STRING = LTrim(STRING);
return RTrim(STRING);
}
function RTrim(STRING){
while(STRING.charAt((STRING.length -1))==" "){
STRING = STRING.substring(0,STRING.length-1);
}
return STRING;
}
function LTrim(STRING){
while(STRING.charAt(0)==" "){
STRING = STRING.replace(STRING.charAt(0),"");
}
return STRING;
}
-->
</script>
<form name="domainCheck" id='domainCheck' style="margin:0; padding:0;" action="">
<h1 class="style19">Domain Checker </h1>
<?php echo $lang['Domain']; ?><input name='sld' type='text' id='sld' size='20' value='' style='height: 15px; width: 100px;' />
<span style="padding:44px;"><select name='ext' id='ext' style='height: 15px; width: 70px; font-size: 12px;'></span>
<?php foreach($LIST_OF_TLDS as $tld){ ?>
<option value='<?php echo $tld; ?>'>.<?php echo $tld; ?></option>
<?php } ?>
</select>
<?php if(!$FORCE_ONLY_DOMAIN){ ?>
<select name='cat' id='cat' style='font-family:calibri,arial,helvetica,sans-serif; font-size:13px; text-align:'center';>
<option value='0'><?php echo $lang['only_domain']; ?></option>
<option selected value='1'><?php echo $lang['with_hosting']; ?></option>
</select>
<?php } ?>
<center><input type="button" name="btn" id='btn' value="<?php echo $lang['Check']; ?>" onClick="javascript:if(this.value!='<?php echo $lang['Please_wait']; ?>')if(this.value=='<?php echo $lang['Check'];?>')makeRequest('whois=true&bool=1&tld='+getObj('ext').options[getObj('ext').selectedIndex].value+'&sld='+getObj('sld').value);else tocart();" style="font-size:15px; font-family:Calibri,Arial,Helvetica,sans-serif; background-color:#efefef; border-bottom:#cccccc 1px solid; border-right:#cccccc 1px solid; text-align:center; width:80%;" /></center >
<div id="whoisresult" style="text-align:center;"></div></p>
</form>
Ideas?