PHP Curl
Posted: Thu Apr 22, 2010 7:19 pm
Heya,
I've got the following code that is posting to a third party billing site. The problem is that it should be following through to the site's hosted page. Unfortunately, this code is simply barfing the contents of that page back into my site's calling page, rather than merrily forwarding off to the third party. I read that this is commonly due to php being in safe mode or having a locked root, but that’s not the case here, as both of those are disabled when I check phpinfo(). I've got to go through the proxy in order to get out. Could that be what's stopping things? There are no errors in the agent if I check it after the call. Am I missing something obvious?
If I call this from http://mysite.com to https://othersite.com/posttome.jsp, I should end up at https://othersite.com/posttome.jsp, right?
thanks,
-nate
I've got the following code that is posting to a third party billing site. The problem is that it should be following through to the site's hosted page. Unfortunately, this code is simply barfing the contents of that page back into my site's calling page, rather than merrily forwarding off to the third party. I read that this is commonly due to php being in safe mode or having a locked root, but that’s not the case here, as both of those are disabled when I check phpinfo(). I've got to go through the proxy in order to get out. Could that be what's stopping things? There are no errors in the agent if I check it after the call. Am I missing something obvious?
Code: Select all
$url = "https://bleh.com/orderform.jsp?";
$param_string = build_param_string($param);
$agent = curl_init($url);
curl_setopt($agent, CURLOPT_PROXY,$proxy_addr);
curl_setopt($agent, CURLOPT_URL, $url);
curl_setopt($agent, CURLOPT_HEADER, 0);
curl_setopt($agent, CURLOPT_POST, count($param));
curl_setopt($agent, CURLOPT_POSTFIELDS, $param_string);
curl_setopt($agent, CURLOPT_FOLLOWLOCATION, 1);
curl_exec($agent);
thanks,
-nate