Hi I am trying to import the following PHP script into bv but it dosnt work when i input it into the html box
help what am i doing wrong
<?php
/**
* Netregistry Console API PHP sample.
* Copyright (c) 2009 Netregistry Pty Ltd.
*
* Authorised for use by official Netregistry resellers only. For support please
* contact resellers@netregistry.com.au
*
* @web www.netregistry.com.au
**/
// Start Domain Lookup Form function
function domainlookupform() {
?>
<table>
<form method='post' action=''>
<tr>
<td>Domain Name: </td><td><input type='text' name='domain' size='20'>
<select name="tld">
<option value=".com.au">.com.au</option>
<option value=".net.au">.net.au</option>
<option value=".org.au">.org.au</option>
<option value=".com">.com</option>
<option value=".net">.net</option>
<option value=".org">.org</option>
</select></td></tr>
</tr>
<td><input type='submit' name='submit' value='Lookup Domain'></td></tr>
</form>
</table>
<?php
}
// End Domain Lookup Form function
// Start Submit and Display Results function
function getResults() {
/**
* BEGIN EDITABLE CONFIGURATION
*/
// connection credentials and settings
$location = 'https://theconsole.netregistry.com.au/external/services/ResellerAPIService/';
$wsdl = $location.'?wsdl';
$username = 'XXXXXXXXXXXXXXXX';
$password = 'XXXXXXXXXXXXXXXX';
// if you do not need to use a proxy host and port, just comment these two lines out
// these are the correct and default settings for use on the Netregistry hosting infrastructure
$proxyHost = '192.168.241.146';
$proxyPort = 3128;
/**
* END EDITABLE CONFIGURATION - SEE BELOW FOR SAMPLE USAGE OF METHODS
*/
$domain = $_POST['domain'];
$tld = $_POST['tld'];
$domainname = $domain . $tld;
// include the console and client classes
include "class_console.php";
include "class_client.php";
// if the proxy and host are not set, set them to null
if(!isset($proxyHost) || !isset($proxyPort) || empty($proxyHost) || empty($proxyPort)) {
$proxyHost = NULL;
$proxyPort = NULL;
}
// create a client resource / connection
$client = new Client($location, $wsdl, $username, $password, $proxyHost, $proxyPort);
/**
* Example usage and output results to screen
*/
// Example #1: Check domain name availability
print('========== consoleMethod[domainLookup] ==========<br/>');
$client->set('domain', $domainname);
$client->domainLookup();
$result = ($client->response());
$array = $result->return->fields->entries;
foreach ($array as $value) {
$i = $value->key;
switch ($i) {
case "domain.status" :
$domainavailability = $value->value;
break;
case "domain.name" :
$domainsearched = $value->value;
break;
}
}
//Displaying results in our own custom way
echo $domainsearched . " is " . $domainavailability;
$client->del('domain');
}
// End Submit and Display Results function
// Start Website Code
// If user have not posted then
if(!isset($_POST['submit'])) {
domainlookupform();
}
// If user has posted form then
if(isset($_POST['submit'])) {
getResults();
}
?>
help what am i doing wrong
<?php
/**
* Netregistry Console API PHP sample.
* Copyright (c) 2009 Netregistry Pty Ltd.
*
* Authorised for use by official Netregistry resellers only. For support please
* contact resellers@netregistry.com.au
*
* @web www.netregistry.com.au
**/
// Start Domain Lookup Form function
function domainlookupform() {
?>
<table>
<form method='post' action=''>
<tr>
<td>Domain Name: </td><td><input type='text' name='domain' size='20'>
<select name="tld">
<option value=".com.au">.com.au</option>
<option value=".net.au">.net.au</option>
<option value=".org.au">.org.au</option>
<option value=".com">.com</option>
<option value=".net">.net</option>
<option value=".org">.org</option>
</select></td></tr>
</tr>
<td><input type='submit' name='submit' value='Lookup Domain'></td></tr>
</form>
</table>
<?php
}
// End Domain Lookup Form function
// Start Submit and Display Results function
function getResults() {
/**
* BEGIN EDITABLE CONFIGURATION
*/
// connection credentials and settings
$location = 'https://theconsole.netregistry.com.au/external/services/ResellerAPIService/';
$wsdl = $location.'?wsdl';
$username = 'XXXXXXXXXXXXXXXX';
$password = 'XXXXXXXXXXXXXXXX';
// if you do not need to use a proxy host and port, just comment these two lines out
// these are the correct and default settings for use on the Netregistry hosting infrastructure
$proxyHost = '192.168.241.146';
$proxyPort = 3128;
/**
* END EDITABLE CONFIGURATION - SEE BELOW FOR SAMPLE USAGE OF METHODS
*/
$domain = $_POST['domain'];
$tld = $_POST['tld'];
$domainname = $domain . $tld;
// include the console and client classes
include "class_console.php";
include "class_client.php";
// if the proxy and host are not set, set them to null
if(!isset($proxyHost) || !isset($proxyPort) || empty($proxyHost) || empty($proxyPort)) {
$proxyHost = NULL;
$proxyPort = NULL;
}
// create a client resource / connection
$client = new Client($location, $wsdl, $username, $password, $proxyHost, $proxyPort);
/**
* Example usage and output results to screen
*/
// Example #1: Check domain name availability
print('========== consoleMethod[domainLookup] ==========<br/>');
$client->set('domain', $domainname);
$client->domainLookup();
$result = ($client->response());
$array = $result->return->fields->entries;
foreach ($array as $value) {
$i = $value->key;
switch ($i) {
case "domain.status" :
$domainavailability = $value->value;
break;
case "domain.name" :
$domainsearched = $value->value;
break;
}
}
//Displaying results in our own custom way
echo $domainsearched . " is " . $domainavailability;
$client->del('domain');
}
// End Submit and Display Results function
// Start Website Code
// If user have not posted then
if(!isset($_POST['submit'])) {
domainlookupform();
}
// If user has posted form then
if(isset($_POST['submit'])) {
getResults();
}
?>
Comment