Hi All,
We've run into a real wierd situation with some php code we've inheirted that we can't figure out. It's driving us nuts.
Here's the code that is being executed:
if (sizeof($HTTP_POST_VARS)>0) {
// Do some error checking
....
// Cut out a bunch of error checking and handling
....
//do curl
$ch = curl_init("http://www.urlvalue.com/servletdir/servlet");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$formData);
$curl_return = curl_exec($ch);
curl_close($ch);
...
}
What is occuring is an apparent recursion through the page when curl_exec is called. By writing to logs on the server, we've observed that as soon as curl_exec is called, the page in which this code exists reloads and then executes the curl_exec again!
This is resulting in a lot of extra traffic by posting twice to our servlet.
The HTML is a fairly simple form with less than 10 fields. We're running Apache on a Debian server.
We'd appreciate any help or suggestions.
TIA, Jim