WHOIS Lookups
From PhpCOIN Documentation
Contents |
WHOIS Basics
phpCOIN v1.2.1b and higher uses its own whois, based loosely on the original mrwhois add-on code. phpCOIN whois and mrWHOIS add-on are not the same thing. Technically the MrWHOIS module is no longer required but can be made to work for phpCOIN v1.2.1 and lower with a few modifications. This article focuses on the whois built-in to phpCOIN.
Control of the phpCOIN WHOIS function is accessed from the Admin Command Centre.
Admin -> WHOIS lookups
Editing a WHOIS lookup
In the following example we are editing the .com entry. For instance you may wish to use an alterate WHOIS lookup URL, or change the "Available" Return String text to it's available.
Edit WHOIS Entry (all fields above the line are required) WHOIS ID: 14 (record_id, auto-generated by phpCOIN) Use It: YES (if we accept this TLD) TLD Display (with DOT): .com TLD Extension(s) (without DOT): com WHOIS URL: whois.networksolutions.com "Available" Return String no match ----------------------------------------------------------- Override Ordered product_id With: (Allows us to change whatever product the client is ordering to THIS product IF the customer clicks the BUY or REGISTER buttons on the WHOIS lookup form during the order process. Notes: Handles .com domains
Instead of the traditional single-word reply, some registration authorities have recently begin to return a formatted text record such as
Status: AVAIL Domain: cantexgroup.ca
phpCOIN v1.2.5 and higher automatically handle this, and v1.2.4 has a "fix-file" available on the phpCOIN CVS Server. If your registration authority is now returning a formatted text record, simply enter ALL of the record into the "Available" string, but WITHOUT spaces, like this:
Status:AVAILDomain:%ORD_DOMAIN%
phpCOIN will replace %ORD_DOMAIN% at run-time with the actual domain name.
Adding a WHOIS lookup
Let's say you want to add the .AU extentions.
.asn.au .com.au .net.au .org.au
From the Admin -> WHOIS section select the [Add New] button and create a WHOIS lookup for each of the above domain names. You would also add the information below.
Whois URL: whois.ausregistry.net.au "Available" Return String: No Data Found
To save you the time of looking up TLD WHOIS servers, the phpCOIN Downloads Site has a file with all TLDs grouped by geographic area.
Web-Based WHOIS
Some TLD's do not offer a traditional WHOIS server, relying instead on a website for lookups. In phpCOIN v2 you can specify whether a lookup is whois-based or web-based, and phpCOIN will act accordingly. But in phpCOIN v1 you will need to edit source code so phpCOIN will use the web-interface for specific TLDs if the web-based whois is not .co.za or .XXX.mt
In /coin_modules/whois/index.php around line 447 you will see this block of code (note that support for .co.za and .XXX.mt web-based whois is already built-in)
# Support .co.za, and .mt
IF ($Lookup_Domain['value'][$x] == 'co.za' || $Lookup_Domain['value'][$x] == 'com.mt' ||
$Lookup_Domain['value'][$x] == 'net.mt' || $Lookup_Domain['value'][$x] == 'org.mt' ) {
$rtn = ffl_HttpGet('http://'.$Lookup_Domain['server'][$x], 0);
$result = $rtn['body'];
You need to add
|| $Lookup_Domain['value'][$x] == 'xxx.yy'
to the lookup line so phpCOIN will know to treat xxx.yy as web-based.
Additionally, to show details for unavailable domains, in /coin_modules/whois/details.php around line 73 is this block of code (note that support for .co.za and .XXX.mt web-based whois is already built-in):
# Support .co.za and .mt
IF (strpos($_GPV['server'], '.co.za') != 0 || strpos($_GPV['server'], '.mt') != 0) {
$rtn = ffl_HttpGet($whois, 1);
$_out .= $rtn['body'];
Again, add
|| strpos($_GPV['server'], '.yy') != 0
to the comparison line so phpCOIN will know to treat yy as web-based.
Add Lookup Form to SiteInfo Page
Within the body of a SiteInfo page, phpCOIN v1.4.0 and higher recognizes several tags and will replace them at run-time with generated content. Several of these tags are:
%PLANS_H% A horizontal hosting products comparison table %PLANS_V% A vertical hosting products comparison table %FORM_WHOIS% A WHOIS lookup form
In order to appear in the horizontal or vertical listing, the product "Domain Type" must be either 1 (Domain - Hosted) or 4 (Subdomain-Hosted). Only "hosted" products will appear in the "hosting plans" listings.

