This is a discussion on cURL Vs Socket within the PHP Language forums, part of the PHP Programming Forums category; hi all, I need to POST values from PHP ie through code to a page on the net. AFAIK there ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
hi all,
I need to POST values from PHP ie through code to a page on the net. AFAIK there seems to be two methods of doing so, first you can use CURL [ curl_exec() ] and secondly open a socket [ fsockopen() ]. So guys, in terms of performance what method would be best to use? Or what are the pros n cons of using these methods. TIA Vish |
|
|||
|
*** Vish wrote/escribió (15 Jun 2005 01:27:40 -0700):
> So guys, in terms of performance what method would be best to use? Or > what are the pros n cons of using these methods. It'd be surprising that posting data through the Internet you faced any performance issue related to choosing either method. 99,9% of your performance will depend on network and remote server. Use sockets if portability is a great issue and curl if you don't want to reinvent the wheel. -- -- Álvaro G. Vicario - Burgos, Spain -- http://bits.demogracia.com - Mi sitio sobre programación web -- Don't e-mail me your questions, post them to the group -- |
|
|||
|
Hello,
on 06/15/2005 05:27 AM Vish said the following: > hi all, > > I need to POST values from PHP ie through code to a page on the net. > AFAIK there seems to be two methods of doing so, first you can use CURL > [ curl_exec() ] and secondly open a socket [ fsockopen() ]. > > So guys, in terms of performance what method would be best to use? Or > what are the pros n cons of using these methods. Using socket connections is preferred not because performance reasons but because cUrl library has problems dealing with certain kinds of servers. You may want to take a look at this HTTP client class that can submits and processes HTTP requests correctly. It can use the cURL library transparently only for SSL requests, but if fsockopen supports SSL it will be used instead of curl. http://www.phpclasses.org/httpclient -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html |