Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Comments for: matt20000305

Message # 1510303:
Date: 11/01/07 09:17
By: Fred
Subject: Example code snipit

Rough example, but it uses the built in
php calls, much better because you should
have "exec" disabled on your server. Curl
has to be compiled in to php on your server.
Search google for curl_init() and maybe find
more examples.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// uncomment the next line if you get curl error 60: error setting certificate verify locations
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// uncommenting the next line is most likely not necessary in case of error 60
// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);

$xmlResponse = curl_exec ($ch);
if (curl_errno($ch) ) {
$error_from_curl = sprintf('Error [%d]: %s', curl_errno($ch), curl_error($ch));
}

curl_close ($ch);


Previous Message | Next Message


Comments:
Example code snipitFred11/01/07 09:17
HTTP_POSTravi11/03/05 01:01
RE: How can you execute a https request in Php?deepa08/22/05 09:04
RE: Atomic transactions?William Gonzalez08/18/05 12:13
Atomic transactions?TheONE08/03/05 09:45
RE: httpsmile07/28/05 04:55
RE: sending sms to indiaSrinivas07/04/05 00:05
Curl for transaction(Please help)kiran01/27/05 07:29
SEND SMS THrough web for freeRanju11/28/04 14:30
Meetul.ComDavid09/04/04 03:58
RE: ip chains (suggestion)albee0105/01/03 09:10
Problem with PHP_AUTH_USERManilal03/22/03 02:09
Refered, parameter -eJordi Lafortune03/04/03 15:51
refered parameter -eJordi Lafortune03/04/03 15:47
RE: sending sms to indiaPratap01/09/03 02:47
RE: sending sms to indiaRandomvariable12/07/02 04:41
looking for a php bank programmerferdinand chekoua wansi10/23/02 08:10
RE: Redirecting UrlsGao10/17/02 10:55
Redirecting UrlsNeena10/07/02 17:01
Transferring files from phpMonx08/08/02 15:52
RE: sending sms to indiaErl08/08/02 10:30
RE: Project with PHPGaetano Giunta07/25/02 08:13
RE: httpsmahadev07/15/02 09:25
Project with PHPKOUAO07/10/02 11:47
sending sms to indiapeer mohamed06/29/02 11:34
How can I install cURL on Windows MEBarbara06/17/02 07:51
PHP 4.3.0 fopen() and httpsAlex06/15/02 07:38
persistent connections across two pagesvito06/06/02 11:20
cURL inaccessibleJohn05/31/02 16:19
persistent connectionsJateen Mistry05/14/02 10:14
RE: httpsDIANA NIÑO 04/26/02 16:04
ok! But what about SSH?pastaska04/17/02 05:07
RE: HTTPS file transfersBela03/19/02 09:41
HTTPs post to a server with authenticationGeorge03/04/02 11:12
cURL https postGeorge03/04/02 11:10
Informations on HTTPSCedric02/13/02 11:45
RE: ayudaJuan Carlos González02/11/02 21:57
RE: httpsJimmy02/09/02 14:56
executablehengky01/30/02 10:36
RE: http://curl.haxx.nu doesn't existWladimir - Br01/28/02 11:28
httpsChristiaan01/22/02 04:56
curl seems not to return anything sometimesMarian01/09/02 05:59
Your suggestions PleaseRokishi12/29/01 11:02
RE: XML File transferPer-Ingar Auberg12/21/01 16:44
XML File transfererik-jan12/19/01 12:03
RE: PHP with SSLsilviu12/18/01 06:57
How save Session with Wmlleexiaobin11/28/01 08:25
HTTPS file transfersDhayes09/05/01 15:18
key to open any siteshahd_1208/14/01 16:06
ayudaJuan José08/13/01 16:15
ayudaJuan José08/13/01 16:15
Accessing http using httpsBob Tapia07/26/01 07:02
RE: http://curl.haxx.nu doesn't existLiudas07/17/01 02:33
posting data to a serverNicole06/26/01 12:10
Given URL incorrrect...Robert J Sherman06/24/01 06:46
RE: cURL for encryption ?Jason Mowat06/14/01 12:43
RE: cURL for encryption ?juvalen06/05/01 12:45
RE: QuestionVladimir05/30/01 05:50
RE: How can you execute a https request in Php?kimby05/22/01 06:11
http://curl.haxx.nu doesn't existRafael Bastidas05/21/01 12:31
RE: PHP with SSLKatie05/18/01 21:08
How can you execute a https request in Php?Deepesh05/12/01 04:17
RE: cURL for encryption ?dargyay05/08/01 12:50
HUGE SECURITY PROBLEMEric Johanson05/02/01 19:44
ip chainsfaryal04/27/01 00:42
RE: PHP with SSLChris von dyk03/23/01 00:02
PHP with SSLPaul03/05/01 06:23
RE: cURL for encryption ?Sezer YALÇIN02/07/01 01:31
Great article.. and question...Jose' L. Landivar01/23/01 03:08
RE: cURL for encryption ?Roger Harrell01/22/01 13:30
cURL for encryption ?Joey12/12/00 00:10
vulnerabilityvAr11/22/00 03:05
https connections with PHP4eXeed10/07/00 10:44
QuestionRyan09/21/00 22:43
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.