InnoHosting
US: 1-888-522-INNO
UK: 0800-612-8075
Linking to WHMCS
Posted by Chris W. on 06 July 2008 10:54 PM

It is very common for users of WHMCS to want to link to WHMCS from their website. This can be in the form of an order link, or with a form that either takes the user straight to the domain checking process to check the availability of the domain they want or to login.

With WHMCS, this is made easy as all the code you need is provided to you customised and ready to insert into your website by simply going to Utilities > Integration Code.


Order Links

You can obtain direct order links for products from the product configuration screen. A direct order link takes the user straight into step two of the order process with the product or service preselected. This is used for order links on your site for specific products. The link looks something like this:


http://yourwhmcsdomain.com/cart.php?a=add&pid=1

Setting the Language/Template via the URL

You can set the language or template to be displayed to the user with the link you use to WHMCS. This is done with links such as:

http://yourwhmcsdomain.com/index.php?systemtemplate=portal

http://yourwhmcsdomain.com/index.php?language=Spanish

These can be combined, used on any page and used with the direct order links

Showing Annoucements on your Site

You can display the announcements on any page of your site using the code below. This will display the latest 3 announcements set to published status.

<?php
include("support/dbconnect.php");
include("support/includes/functions.php");
$query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC LIMIT 0,3";
$result = mysql_query($query);
while ($data = mysql_fetch_array($result)) {
$id = $data["id"];
$date = $data["date"];
$title = $data["title"];
$announcement = $data["announcement"];
$date = fromMySQLDate($date);
echo("<p><font color=#cccccc>$date</font> - <b>$title</b><br>$announcement</p>");
}
?>

You should replace the word support in the first two lines where it includes files from the WHMCS folder with the path to your WHMCS directory.


(253 vote(s))
Helpful
Not helpful

Comments (0)