Jump to content

POST method: add a domain and hosting at the same time


Tapeix

Recommended Posts

I want to redirect the visitors from my website to WHMCS using POST method.

 

The solution is pretty simple: users fill in a domain using the code below, after they click 'Go', they'll be redirected to WHMCS; once they have found a propitiate domain, they are redirected to the cart with a hosting package attached to this order. Unfortunately, after adding pid=80 to the url below the POST method does not work. The value is not transmitted to WHMCS any longer. Does someone have a solution?

 

<form action="https://url.com/cart.php?a=add&pid=80&domain=register" method="post">
Find your Domain: <input type="text" name="query" size="20"/>
<input type="submit" value="Go"/>
</form>

Link to comment
Share on other sites

I think the documentation is still correct and you'll need to split query into SLD and TLD (e.g google and .com) and pass them separately to the cart... either by splitting the form, or splitting the query variable before passing it to the cart.

 

http://docs.whmcs.com/Linking_to_WHMCS

 

http://demo.whmcs.com/cart.php?a=add&pid=1&sld=google&tld=.com

to use this in a form, you could revert to the old integration code from v5 as a starting point...

 

<form action="https://url.com/cart.php?a=add&pid=80&domain=register" method="post">
Find your Domain: <input type="text" name="sld" size="20" /> <select name="tld">
<option>.org.uk</option>
<option>.co.uk</option>
<option>.me.uk</option>
<option>.com</option>
</select>
<input type="submit" value="Go" />
</form>

obviously, in the above example, it's using a dropdown for the TLDs - but you could use another text field or even radio buttons... if using a non-text field, it might be easier to use a data feed to get the TLD list (or the whole form) - or perhaps a hook if it's another whmcs page.

 

the above code should let the customer choose a domain and then move on to configure the attached product. :idea:

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