Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Domain API Loop in PHP
Old 11-15-2010, 09:06 AM Domain API Loop in PHP
Junior Talker

Posts: 1
Name: Dave
Trades: 0
How can I perform the following with this API?

Form is setup in PHP for registered user to enter domain name
On submit..

Check if domain is available >

- If NO > output to XML > run the loop again in 5 minutes
- If YES > output to XML > go ahead and purchase & register the domain > end loop

Thank you!

Sample API code

PHP Code:
    <?php /**  * Set the API URL  */ $sApiUrl "https://www.apiurl.com/";
    
    
    
/**  * Set POST Parameters  */ $aParams = Array(
                
'uid'     => "--USERNAME--",    // Username
                
'pw'      => "--APIKEY--",      // API Key
                
'command' => "querydomain",     // Command to Rum
                
'sld'     => "sampledomain",    // Main part of the Domain
                
'tld'     => "com");         // Domain Extension
    
    
    /**  * Run the cURL command  */
    
$oCurl curl_init(); curl_setopt($oCurlCURLOPT_URL$sApiUrl);
    
curl_setopt($oCurlCURLOPT_POST1);
    
curl_setopt($oCurlCURLOPT_POSTFIELDS$aParams);
    
curl_setopt($oCurlCURLOPT_RETURNTRANSFERtrue);
    
curl_setopt($oCurlCURLOPT_SSL_VERIFYPEERfalse);
    
$sResponse curl_exec($oCurl); curl_close($oCurl);
    
    
    
/**  * Turn results into Simple XML Object  */
    
$oOutput = new SimpleXmlElement($sResponse);
    
    
    
/**  * Debugging output, so we can see what we just got  */
    
print_r($oOutput);
    
    
?>
API Commands

Quote:
check Checks whether a domain name is available for registration.
purchase Registers a new domain name.
transfer Requests a domain transfer to registrar.
extend Extends (renews) domain registration.
changepassword Changes the domain password.
sendpassword Send domain password to domain owner.
contacts Changes domains contacts.
querydomain Returns detailed information about the domain.
sendepp Sends gTLD epp key to domain owner.
refillaccount Refills your reseller account with funds.
changedomainns Changes domains name servers.
sendtransferemail Sends transfer authorisation request to domain owner.
addchildns Add child name server to domain.
updatechildns Update details for child name server.
removechildns Remove child name server from domain.
pushdomain Push domain to another registrar reseller.
getdnsrecords Get domain name server records for a domain.
enablednsdomain Create DNS domain service for domain.
adddnsrecord Add new DNS record to domain.
updatednsrecord Update DNS record for a domain.
removednsrecord Remove DNS record from a domain.
updatednssoa Update DNS SOA record for a domain.
disablednsdomain Destroy DNS domain service for a domain.
getmailrecords Get mail forwarding records for a domain.
addmailforwarder Add a mail forwarder to a domain.
removemailforwarder Remove a mail forwarder from a domain.
updatemailforwarder Update the details of a Mail Forwarder for a domain.
geturlrecords Get URL Forwarding records for a domain.
addurlforwarder Add a URL Forwarding record to a domain.
updateurlforwarder Update a URL Forwarding record for a domain.
removeurlforwarder Remove a URL Forwarding record for a domain.
getreglock Get registry lock details for a domain.
setreglock Set a registry lock for a domain.
updatecontact Update an address book entry.
getapiinfo Get information about the Domain System API.
transferout Push a domain name to another registrar, given their tag.
supraicer69 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Domain API Loop in PHP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.39864 seconds with 12 queries