Tapeix Posted November 3, 2016 Share Posted November 3, 2016 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> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 3, 2016 Share Posted November 3, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
Tapeix Posted November 4, 2016 Author Share Posted November 4, 2016 Superduper. Thanks Brian! Fixed. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.