theouimets@hotmail.com wrote:[color=blue]
> Is there a limit to how long a URL can be with fopen? I have a very
> long URL as there are lots of things to be passed some variables and
> some XML. It seems to get to a certain point and then produce an error
> with no details and just cuts it off.
>[/color]
With long requests it's almost always better to use the POST method instead
of GET.
Consider the following snippet or use one of the many classes available on
the net:
// Construct the request string
$request = "API=test&XML=" . urlencode("<FormLastName...");
// Open connection
$fp = fsockopen("test.com", 80);
// Send the request
fputs($fp, "POST /Test.dll HTTP/1.0\r\n");
fputs($fp, "Host: test.com\r\n");
fputs($fp, "Content-Length: " . strlen($request) . "\r\n");
fputs($fp, "Content-Type: application/x-www-form-urlencoded\r\n\r\n");
fputs($fp, "$request\r\n");
fputs($fp, "\r\n");
// Print the response
fpassthru($fp);
// Close the connection
fclose($fp);
JW