PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to make part of my script send some data to another page. It doesn't seem to be working correctly. It connects to the URL it is suppose to, but it doesn't post the fields.
$fp=fopen("debug.txt","w");
// init curl here then, configure to redirect the output to a file
curl($ch,CURLOPT_STDERR,$fp);
curl($ch,CURLOPT_VERBOSE,TRUE);
// do your curl stuff stuff here and close it
fclose($fp);
echo "<pre>".file_get_contents("debug.txt")."</pre>";
Also you shouldn't need to urlencode your keys, but I don't think it will hurt anything. If curl is getting redirected it probably isn't reposting your data. There's a number of other things that can effect what happens to post data too depending on the type of connection you're trying to establish. So if you can't find the cause of your problem, repost the debug.txt here.
* About to connect() to www.textgamemaker.com port 80 (#0)
* Trying 50.22.195.155...
* connected
* Connected to www.textgamemaker.com (50.22.195.155) port 80 (#0)
> POST /postbacktestphp HTTP/1.1
@twindev cURL is pretty complex; it's practically a language on it's own. In fact the php extensions can't do a lot of things the current builds of curl support. And it seems I learn something new about it whenever I dig deeper. But I must admit I feel like a broken record on this forum repeating how to get the debug info over and over....
@FounderSim this should be a clue:[text]< HTTP/1.1 404 Not Found[/text]
The page you're trying to post to:
From what you posted curl is definitely not reaching your test page. There's no reason curl would remove the dot either. Are you sure the only problem is the data method?