There are several alternatives when it comes to grabbing data from elsewhere on the internet with your scripts, and cURL is one of them. It's not built into most PHP builds, so it's not the easiest to use in most situations, but it can, at times, be more powerful. In this new tutorial from PHPBuilder.com, they show you how to harness this power and use cURL with PHP.
cURL is one of the most powerful PHP extensions. It stands for Client URL, and allows you to communicate with other servers using a wide range of protocols. Perhaps that sounds fairly uninteresting, but give it some more thought. libcurl (the library behind the PHP cURL extension) currently supports a wide range of protocols, including HTTP, HTTPS, FTP, TELNET, FILE, LDAP, DICT, GOPHER and HTTPS, as well as HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, and user:password authentication.
Unfortunately cURL does not come with PHP by default. This tutorial assumes you know how to install extensions (or even better, know someone who does). The PHP/cURL page will have details for more recent versions of PHP. You can read the PHP manual for more about installing Windows extensions, and extensions in a Unix environment.
They assume that you have it installed already and jump right into the code, giving you a sample client to grab a remote page. They go on, showing you how to: get a word definition, access password-protected pages, return file info from a remote server, posting variables to a remote script, and FTP'ing a file to a server. It really is a really handy extension...




