Jump to content

CURLOPT_POSTFIELDS hangs and is unresponsive


timlondon

Recommended Posts

Hi guys, any help would be appreciated with the below problem.

 

I am attempting to use CURLOPT_POSTFIELDS to send a variable from originator.php to receiver.php but originator.php just hangs. No errors are reported and i know that the problem lies with curl because if i comment-out the entire curl section then the end echo "finished" is displayed and the script terminates.

 

originator.php:

 

$ch = curl_init("http://www.testdom.com/originator.php");

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, "testvar=piggies");

$resp = curl_exec($ch);

echo $resp;

curl_close($ch);

echo "finished";

 

receiver.php:

 

ob_start();

$tv=$_POST['testvar'];

 

my server has the following: libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.