Zend - The PHP Company




HTTP

Add Code


ENOM reseller helper  

Type: class
Added by: conrad_escape
Entered: 28/01/2004
Last modified: 01/12/2003
Rating: - (fewer than 3 votes)
Views: 4281
see code comments


<?php
//example
require("class.enom.php");

$enom_user='reseler';//valid reseller user
$enom_pass='password';//valid reseller password
$enom = new enom($enom_user,$enom_pass);

$domain 'example.com';

if (
$enom->valid($domain)) 
{
  
$ld $enom->ld($domain); // $ld['sld'] = example ; $ld['tld'] = 'co.uk'
  
  
$input['command']                        = 'Purchase';
  
$input['sld']                            = $ld['sld'];
  
$input['tld']                            = $ld['tld'];
  
$input['NS1']                            = 'NS1.MY-HOST-COMPANY.COM';
  
$input['NS2']                            = 'NS2.MY-HOST-COMPANY.COM';
  

  
// enom query
  
echo 'QUERY:<br><pre>';
  
print_r($input);
  echo 
'</pre>';
  
  
//submiting the quey
  
$response $enom->submit($input); 
  
  
//enom response
  
echo '<hr>RESPONSE:<br><pre>';
  
print_r($response);
  echo 
'</pre>';
  
  
//in there enom errors are they ? (c)yoda
  
echo '<br>';
  
$errors $enom->enom_errors($response);
  if (
$errors === false)
  {
    echo 
'No errors!'
  }
  else
  {
    echo 
'<hr>ERRORS:<br><pre>';
    
print_r($errors);
    echo 
'</pre>';
  }
  
}
else
{
  echo 
'Domain ['.$domain.'] is invalid.'
}


/* !!!!!!!
some tld's, like 'co.uk' need "extended atributes" 
find them using:

  $input['command']                        = 'getextattributes';
  $input['tld']                            = 'co.uk';

*/

?>


Usage Example


See the example


Rate This Script





Search



This Category All Categories