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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.