Jump to content

Domain Checker -- Possible to Merge?


manicdog

Recommended Posts

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?

Link to comment
Share on other sites

not liking that:

 

> new ActiveXObject("Msxml2.XMLHTTP");

> new ActiveXObject("Microsoft.XMLHTTP");

 

Would seem to me, that script wants to be running on a windows box.. eww :P Not 100% what you want to achieve, but WHMCS is 100% customisable and unique domain checkers can be achieved relatively easily.

 

My personal favourite, and the one im going to attempt to imitate something similar is http://www.getdotted.com - purely as you can select to purchase multiple domains. This would require 1 domain to be registered and the rest to be parked, if this was automated.. maybe needs some thought but no doubt can be achieved.

Link to comment
Share on other sites

Yes, I'm familiar that it's from ALP -- from their public forums, not proprietary.

 

(note, I didn't take it from them as you infer.)

 

It is completely proprietary as it was made to work directly with ALP. It was also written by one of the ALP devs, which i highly doubt can legally make any code free while on the job. Just because its in public view, doesnt mean you can use it for whatever you like. Content in any forum on any site is not able to be used for any purposes without prior consent from the poster(s). Believe me, i have been doing this job long enough to know the rules.

Link to comment
Share on other sites

not liking that:

 

> new ActiveXObject("Msxml2.XMLHTTP");

> new ActiveXObject("Microsoft.XMLHTTP");

 

Would seem to me, that script wants to be running on a windows box.. eww :P Not 100% what you want to achieve, but WHMCS is 100% customisable and unique domain checkers can be achieved relatively easily.

 

My personal favourite, and the one im going to attempt to imitate something similar is http://www.getdotted.com - purely as you can select to purchase multiple domains. This would require 1 domain to be registered and the rest to be parked, if this was automated.. maybe needs some thought but no doubt can be achieved.

 

Unfortunately since WHMCS cant work as a cart, this wouldnt even be possible to order multiple domains at once.

Link to comment
Share on other sites

I personally would be interested in seeing WHMCS moving towards a cart style order forms, bedot in the next 3 months are looking at add more hardware solutions (firewalls etc) and software solutions (antivirus) and this would make this alot easier as well as the multiple domains.

Link to comment
Share on other sites

Carts definitely complicated the situation. I would recommending searching thte forums to see if its already been brought up as a feature, if not, start the topic and we can continue the conversation there. right now we are kind of hijacking this thread.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated