Jump to content

seeking url data var stream to submit domain for registration


durangod

Recommended Posts

Hi,

 

I worked out another domain helper (suggestion) tool and im having issues with the $_GET url submission. I am using this from my tool to the WHMCS platform

 

https://www.mysite.com/billing/cart.php?a=add&domain=register

 

the problem is that the domain name does not get sent with it to WHMC. And the url that i see for WHMCS im sure many of the vars are hidden for good reason.

 

You can pm me if you need to but does anyone know the rest of the url vars i need in the string in order to have WHMCS grab the domain name. I guess i can rip the tpl file apart and see but it still may not be all i need.

 

Im thinking something like

 

https://www.mysite.com/billing/cart.php?a=add&domain=register&domain=whatever.com&... and so on

 

any ideas? thanks

Edited by durangod
Link to comment
Share on other sites

unless i'm missing the point (has been known!), isn't the problem caused by your links containing & rather than just & ??

 

so the following link won't work...

 

https://www.mysite.com/billing/cart.php?a=add&domain=register

but this one would...

 

https://www.mysite.com/billing/cart.php?a=add&domain=register

Link to comment
Share on other sites

no sir it has to be & in order to pass W3C validation, the parsed url is just & but W3C requires the ASCII value i guess in order to validate.

 

the current url works, however im being picky and it does not input the domain into the input field of WHMCS for the user.

 

For example.. they use the alternate domain tool (which searchs a differt way then the WHMCS version) and the results are output onto the html page, when the user clicks on a domain name it goes to the domain registration page just fine. But then they have to retype the domain name.

 

Sometimes they forget which one they chose from the list lol... so im just trying to carry that domain and tld forward to WHMCS via the url vars..

 

I tried a different link as a test... i used domainchecker.php rather than cart.php

 

https://mysite.com/billing/domainchecker.php?domain=whatever

 

now that gets me one step closer as i found in the tpl that domain is the var that page needs. So with that, it will at least put the domain name in the input for them on the domainchecker page. Then they can choose which box they want for the tld and see the prices after the search..

 

When i started this i really didnt expect to be able to perform a full fledge connection between this new tool like the other ones i have, because im not using my registrar's array on this one. Im using another companies search results so it does not have all the things i need to do this unless i want to make a mountain out of a molehill just become some people cant remember a domain they chose on a list lol..

 

I guess im looking for a happy medium, what i have now i guess in some way answers the call of the customer to put the name in the input box on the WHMCS side, but for me it also allows WHMCS to reverify the domain is available as well rather than just trust the other company compeletely.

 

What im doing is improving my domainsbot.com API hookup so it works better for my customers. Its just another way to search for a domain name if you dont know what you want..

Edited by durangod
Link to comment
Share on other sites

here is what i ended up doing afterall.

 

i went back to the original link for the cart... but added sld value to it

 

https://www.mysite.com/billing/cart.php?a=add&domain=register&sld=%domain%  

 

and then just modified the

templates/orderforms/comparison/adddomain.tpl

 

 

i have to check to see if its comming from the GET or the SMARTY POST value first. And depending on that i split up the first couple of lines of the form input into two different inputs.

 

If the GET is there, then it will assign the value of that to the input value.

 

If the POST is there it will do the POST value from SMARTY.

 

if neither are there then it is just blank.

 

I also had to take the domain name (the GET sld value) and take away the extention from it so the input for the GET would only be the domain name.

 

here is the code:

 

 


<!-- if the sld does not come from whmcs smarty then it means it has to come from the GET via the alternative domain checker and so assign it by php and skip the smarty section. -->

{php}
//check the get value
if($_GET['sld'])
{
{/php}

<!-- check to see if the smarty $sld value is NOT there -->
{if !$sld}  
{php}
     if($_GET['sld'])
     {
      $sldpre = $_GET['sld'];
      $sldarray = explode('.',$sldpre);
      $sld = $sldarray[0];
       }
{/php}

<!-- this is executed only on the GET -->
<form onsubmit="checkavailability();return false">
<div class="domainreginput">www. <input type="text" name="sld" id="sld" size="25" value="{php}echo $sld{/php}" /> 

{/if}

{php}
//else if not get sld then run as normal
}else{ 
{/php}

<!-- this is executed only on the POST or no data at all -->

<form onsubmit="checkavailability();return false">
<div class="domainreginput">www. <input type="text" name="sld" id="sld" size="25" value="{$sld}" /> 

{php}
 }//close else
{/php}

<!-- and then continue the rest of the form as normal -->



Edited by durangod
Link to comment
Share on other sites

I just wanted to add (before i forgot again) that the WHMCS page im referring to on this mod can be seen by going to the main portal page, click order then click register domain and youll see the input for the domain on the page.

 

This mod just does the name, i am considering going ahead and adding more code to also select the tld (ext) as well just to make it easier so i may end up just making two full forms - one for each if segment.

Edited by durangod
Link to comment
Share on other sites

here is the full mod to adddomain.tpl including the domain name, tld, and the select option which shows the abbreviated list of tld available via the alternate domain checker and a text note at the top which tells them how to reset the page if they want more tld to choose from.

 

I dont think there is any need to sanitize the GET sld because im pretty sure it all gets sanatized after this point in the process during the normal WHMC process that follows this file, but if it makes you feel better you can sanitize it.

 

<p class="domainregtitle">{if $domain eq "register"}{$LANG.registerdomaindesc}{else}{$LANG.transferdomaindesc}{/if}</p> 

{php}
if($_GET['sld'])
{
{/php}

<p>If you have arrived here via our "alternate domain checker" then the domain name and extention has already been added for you. You must re-check availability to begin the order process.  Also remember using the alternate checker you are limited to certain tld(ext).  If you prefer a full selection of our available tld(ext) to choose from you must abandoned this process now and restart the order by clicking 
<a href="{$smarty.server.PHP_SELF}?a=add&domain=register">Restart Order</a></p> 

{php}
 }//close if
{/php}



{if $errormessage}<div class="errorbox">{$errormessage|replace:'<li>':'  #  '}  #  </div><br />{/if}


<!-- if the sld does not come from whmcs smarty then it means it has to come from the GET via the alternative domain checker
and so assign it by php and skip the smarty section. -->

{php}
if($_GET['sld'])
{
{/php}

{if !$sld}  
{php}
     if($_GET['sld'])
     {
      $sldpre = $_GET['sld'];
      $sldarray = explode('.',$sldpre);
      $nsld = $sldarray[0];
      // $normtld = $sldarray[1];
      $ntld = ".".$sldarray[1];
       }

// these are the only tlds that the alternate checker will find
$tldarray = array(".com", ".biz", ".net", ".org", ".us", ".info", ".name", ".ca", ".tv", ".mobi", ".pw", ".ws", ".xxx", ".me");


{/php}

<form onsubmit="checkavailability();return false">
<div class="domainreginput">www. <input type="text" name="sld" id="sld" size="25" value="{php}echo $nsld;{/php}" /> 
<select name="tld" id="tld">
{php}
foreach($tldarray as $value)
{
{/php}
 <option value="{php} echo $value;{/php}" 
  {php} 
   if($value == $ntld)
    { 
   {/php} 
    selected = "selected" 
  {php}
    } 
 {/php}>
 {php} echo $value;{/php}
 </option>

{php}   
}//close foreach
{/php}

</select>
{/if}

{php}
//else if not GET sld then run as normal
}else{ 
{/php}

<form onsubmit="checkavailability();return false">
<div class="domainreginput">www. <input type="text" name="sld" id="sld" size="25" value="{$sld}" /> 
<select name="tld" id="tld">
{foreach key=num item=listtld from=$tlds}
<option value="{$listtld}"{if $listtld eq $tld} selected="selected"{/if}>{$listtld}</option>
{/foreach}
</select>

{php}
 }//close else
{/php}

  <input type="submit" value=" {$LANG.checkavailability} " class="cartbutton green" /></div>
</form>

Edited by durangod
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