Filename: dotpk_whois.php -
Download
<?php
// +----------------------------------------------------------------------+
// | Filename: dotpk_Whois.php |
// | |
// | Version: 0.01 (Dated: February 13, 2006) |
// | |
// | Copyright: NONE - You are free to use and modify this code as |
// | you need. |
// | |
// | Authors: Khalil Ahmad <khalil@paksys.com> |
// | PakSys Software LLC. |
// | |
// | Description: This is a sample code to consume PakNIC Whois |
// | Web Service to get .PK domain whois record. |
// | |
// | Returns: Array of string with complete domain whois detail |
// | and DNS Servers, etc. |
// | |
// | Change Log: |
// | |
// | Note: Whois.net.pk web service requires a Username and |
// | and password which you can get free by signing up |
// | at http://whois.net.pk |
// +----------------------------------------------------------------------+
//
// Include Nusoap.php file
require_once('lib/nusoap.php');
$strUser = ""; // <=== Enter your Username as provided by http://whois.net.pk
$strPasswd = ""; // <=== Enter your Password as provided by http://whois.net.pk
$strSLD = "microsoft";
$strTLD = "com.pk";
// Define needed parameters and put them in an array.
$parameters[] = array(
'strSLD' => $strSLD,
'strTLD' => $strTLD,
'strUser' => $strUser,
'strPasswd' => $strPasswd
);
// Define new object and specify location of wsdl file.
$soapclient = new soapclient('http://whois.net.pk/webservice/Whois.asmx?WSDL',True);
$err = $soapclient ->getError();
if ($err) {
// Display the error
echo "client construction error: " . $err ;
} else {
// call the method and get the result.
$result = $soapclient->call('GetWhoisRecord',$parameters);
$err = $soapclient ->getError();
if ($err) {
// Display the error
echo "Call error: <pre>$err";
//print_r($soapclient ->response);
//print_r($soapclient ->getDebug());
echo "</pre>";
} else {
// Print out a nice formatted return string
print_r($result);
echo "<hr><pre>".$result["GetWhoisRecordResult"]."</pre><hr>";
}
}
?<
|
Filename: dotpk_CheckDomain.php
- Download
<?php
// +----------------------------------------------------------------------+
// | Filename: dotpk_CheckDomain.php |
// | |
// | Version: 0.01 (Dated: February 13, 2006) |
// | |
// | Copyright: NONE - You are free to use and modify this code as |
// | you need. |
// | |
// | Authors: Khalil Ahmad <khalil@paksys.com> |
// | PakSys Software LLC. |
// | |
// | Description: This is a sample code to consume PakNIC Whois |
// | Web Service to check whether a .PK domain is |
// | is available for registration or not. |
// | |
// | Returns: 200 if Domain is Expired / De-activated |
// | 210 if Domain is Available |
// | 211 if Domain Taken |
// | 0 if Whois Web Service Authentication Failed |
// | -1 if any Error Occurred while checking domain |
// | -2 if the domain name is Invalid |
// | |
// | Change Log: |
// | |
// | |
// | Note: Whois.net.pk web service requires a Username and |
// | and password which you can get free by signing up |
// | at http://whois.net.pk |
// +----------------------------------------------------------------------+
//
// Include Nusoap.php file
require_once('lib/nusoap.php');
$strUser = ""; // <=== Enter your Username as provided by http://whois.net.pk
$strPasswd = ""; // <=== Enter your Password as provided by http://whois.net.pk
$strSLD = "microsoft";
$strTLD = "com.pk";
// Define needed parameters and put them in an array.
$parameters[] = array(
'strSLD' => $strSLD,
'strTLD' => $strTLD,
'strUser' => $strUser,
'strPasswd' => $strPasswd
);
// Define new object and specify location of wsdl file.
$soapclient = new soapclient('http://whois.net.pk/webservice/Whois.asmx?WSDL',True);
$err = $soapclient ->getError();
if ($err) {
// Display the error
echo "client construction error: " . $err ;
} else {
// call the method and get the result.
$result = $soapclient->call('CheckDomain',$parameters);
$err = $soapclient ->getError();
if ($err) {
// Display the error
echo "Call error: <pre>$err";
//print_r($soapclient ->response);
//print_r($soapclient ->getDebug());
echo "</pre>";
} else {
// Print out a nice formatted return string
print_r($result);
echo "<hr><pre>".$result["CheckDomainResult"]."</pre><hr>";
}
}
?<
|