I'm attempting to learn how to use curl in php from a tutorial. I have one php script communicating with another. The first script is:
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,"http://localhost/some_directories/testing.php");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Baz=Wombat");
curl_exec ($curl);
curl_close ($curl)
And a second 'testing.php' script contains only the php tags and: var_dump($_POST);
When I run the first script I get the output: var_dump($_POST);
instead of the posted values. I'm sure this is something obvious, but I'm not sure why it's happening.
"; var_dump($_GET); to the second script and then pinging that page with this http://localhost/some_directories/testing.php?Hello=World&Foo=Bar&Baz=Wombat – ssaltman Dec 19 '13 at 19:40