Re: cURL uses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, November 15, 2006 2:19 pm, Philip Thompson wrote:
> I've been doing some reading trying to figure out why I would want to
> use cURL. I have not found a solid reason yet. Does anyone have a
> useful example on why you would want to use cURL?

#1.
To beef up your biceps.

#2.
Suppose, for the sake of argument, that you wanted to "log in" to a
website to gather some data, rearrange it for your own convenience,
and then store/use that data.

Also assume that the website you want to "log in" to uses HTTPS, aka
SSL, aka that little lock thingie in your browser shows it as "safe"
with the lock "closed"

You could, if you were insane, attempt to re-code the entire SSL spec
with all the public/private key cryptographic mintuae.  That would
probably only take a month or two of coding in PHP.

Or, you could just use cURL to connect and get what you want:
http://php.net/curl

curl can also be handy if you need to acquire multiple pages from the
same site, as it can handle the keep-alive stuff nicely.

Oh, and it also make it easy to maintain the cookies of a logged in
site, SSL or not, if you don't mind not being able to get the other
headers from the page when you let curl handle the cookies with the
COOKIE_FILE and COOKIE_JAR settings.

Other than those, it probably is overkill compared to
file_get_contents().

Though back in PHP3 days, there was no file_get_contents() and it was
a tie between curl and fopen/fread with all the error-checking.

Hope that helps.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux