Difference between revisions of "Linking to WHMCS"

From WHMCS Documentation

Line 17: Line 17:
 
   $title = $data["title"];
 
   $title = $data["title"];
 
   $announcement = $data["announcement"];
 
   $announcement = $data["announcement"];
   $date = fromMySQLDate($date);
+
   <nowiki>$date = fromMySQLDate($date);
   echo("<p><font color=#cccccc>$date</font> - <b>$title</b><br>$announcement</p>");
+
   echo("<p><font color=#cccccc>$date</font> - <b>$title</b><br>$announcement</p>");</nowiki>
 
  }
 
  }
 
  ?>
 
  ?>
  
 
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.
 
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.

Revision as of 16:20, 16 March 2008

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.

Showing Annoucements on your Site

You can display the announcements on any page of your site using the code below. This will display all the announcements set to Published.

<?php
include("support/dbconnect.php");
include("support/includes/functions.php");
$query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC"; 
$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.