ID: 8440 Comment by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Closed Bug Type: HTTP related Operating System: Debian Linux 2.2.14 PHP Version: 4.0.4pl1 New Comment:
I was pulling my hair out trying to figure this one out myself for a while. I finally noticed that my users were submitting a space character on a form, that sent its value to a php script that used that value in a file() call. It made my url end up looking like this: http://www.mysite.com?i=1&t=2&x= 5&m=4 I know this is lazy coding on my part that caused this, but I have now fixed it. Just a heads up to double check your data that gets sent into the function for silly little stuff like this. Previous Comments: ------------------------------------------------------------------------ [2002-04-21 12:40:08] [EMAIL PROTECTED] you can open a remote file with the fsockopen command I use this function when I had this problem /**********************************************************/ function sendToHost($host,$method,$path,$data,$useragent=0) { // Supply a default method of GET if the one passed was empty if (empty($method)) $method = 'GET'; $method = strtoupper($method); $fp = fsockopen($host,80); if ($method == 'GET') $path .= '?' . $data; fputs($fp, "$method $path HTTP/1.1\n"); fputs($fp, "Host: $host\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\n"); fputs($fp, "Content-length: " . strlen($data) . "\n"); if ($useragent) fputs($fp, "User-Agent: MSIE\n"); fputs($fp, "Connection: close\n\n"); if ($method == 'POST') fputs($fp, $data); while (!feof($fp)) $buf .= fgets($fp,128); fclose($fp); return $buf; } /**********************************************************/ ------------------------------------------------------------------------ [2002-03-17 16:13:04] [EMAIL PROTECTED] Or, just as good, is there an alternate way to open a remote file? ------------------------------------------------------------------------ [2002-03-17 16:07:56] [EMAIL PROTECTED] Uggh...is there any way to fix it without waiting a month? ------------------------------------------------------------------------ [2002-03-17 15:34:47] [EMAIL PROTECTED] In about a month. Derick ------------------------------------------------------------------------ [2002-03-17 15:24:59] [EMAIL PROTECTED] When will the 4.2.x branch be out though? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/8440 -- Edit this bug report at http://bugs.php.net/?id=8440&edit=1