PHP supports libcurl that allows you to connect and communicate to many different types of servers with many different types of protocols.
libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, and user+password authentication.
Here's a quick scan of how I just wasted several days and couple of hours trying to integrate simple PHP curl codes with existing API backends from Enom and Namecheap. Currently Namecheap does not have publicly available integration interface that is as simple as 1-2-3 site installation.
Now the fun begins.
$url = 'API server host';
$curl;
$curl = curl_init();
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($curl, CURLOPT_URL, $url);
$result = curl_exec($curl);
curl_close($curl);
header('Content-Type: application/xml; charset=ISO-8859-1');
print $result;
By default, curl makes use of HTTP-GET unless explicitly specified to be false and as HTTP-POST method.
This PHP codes simply checks a specified particular domain TLD via PHP form, for the possibiblity of domain existence. That's it. As we all know, the free WHOIS and DOMAINTOOLS servers are limited by request for security reason, that is why this code has been created for some time. Note that the return results from Namecheap API server https://api.sandbox.namecheap.com comes in XML format.
Probability is, this is the same approach that has been utilized for desktop and web applications like twitter, entrecard, myblog, and even YMail and GMail - the difference is that the front-end differs, where a few of them enjoyed more of AJAX and SOAP. :) The rest are PHPs.
Furthermore, these codes can also be expanded to actually register domains, and even have a full-pledged DNS control and management system acting as domain registrar platform, like Godaddy, Namecheap, Onlinenic and Enoms.
For the docs.
Categories
- HowTos (611)
- Linux Devices (39)
- Linux Diggs (620)
- Linux News (1542)
- Linux Videos (24)
Recent Posts
Blog Archive
-
►
2008
(2302)
-
►
October
(140)
- Linus Torvalds on Linux Distributions
- AMD to Spin off Manufacturing Operations
- MySQL cofounder David Axmark leaving Sun
- Mono to contribute back to CLI; Microsoft says it ...
- Monitor your network with GroundWork Monitor Commu...
- The LXF Guide: Write a Perl module
- 8 Best First-person Shooter Games for Linux
- AppDeploy Community Launches Free Windows Installe...
- Ubuntu Tweak - Sneak Peak at Latest Version!
- POS stack targets Linux netbooks
- RIP LinuxWorld
- Firefox extension blocks dangerous Web attack
- Wikia co-founder to speak at linux.conf.au
- Wikia co-founder to speak at linux.conf.au
- Look Ma, No ‘X’
- Look Ma, No ‘X’
- Forget the damn Linux netbooks. Can Windows replac...
- Forget the damn Linux netbooks. Can Windows replac...
- Amarok 2.0 Beta 2 was released
- 6 Years As A Professional Software Developer
- Amarok 2.0 Beta 2 was released
- 6 Years As A Professional Software Developer
- Distribution Release: EnGarde Secure Linux 3.0.21
- Torvalds talks about his brand new blog
- Become a multimedia pro with the Vector Linux Mult...
- Linux Robot - Watch This Space
- Distribution Release: EnGarde Secure Linux 3.0.21
- Torvalds talks about his brand new blog
- Become a multimedia pro with the Vector Linux Mult...
- Linux Robot - Watch This Space
- Linux-Based E-Voting In Brazil
- Is .NET on Linux Finally Ready?
- Linux-Based E-Voting In Brazil
- Multi-core networking stack ported to PowerPC
- Google rev's photo editor for Linux
- Project releases version 2.0 of open source .Net
- One more 2.6.27 prepatch
- Stallman vs. Clouds
- How to Create and Use a Password Reset Disk in Win...
- OpenOffice.org Grows Up
- 45+ Sources and Sets of Photoshop Custom Shapes
- Clean up your filesystems with fslint
- NPX-9000 UMPC is inexpensive but underpowered
-
►
October
(140)
Saturday, June 20, 2009
How To Perform HTTP-GET via Curl Commands inside PHP
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy


1 comments:
I am new in this field, I was searching blog which is related to
Networking. I have a blog related to
Network Fundamental, i needed information, I got u, really the Article is Very good,
Thanks for your contribution.
Post a Comment