Page 1 of 1

Bad request: probably tried to POST a non-executable URL

Posted: Sat Dec 20, 2003 1:58 am
by tecton
i keep getting this error

using latest version of xitami and php windows xp

Posted: Sat Dec 20, 2003 3:03 am
by m3mn0n

Posted: Sat Dec 20, 2003 8:48 am
by tecton
no that doesnt help

Posted: Sat Dec 20, 2003 2:42 pm
by tecton
if someone knows the answer to this please help

Posted: Sat Dec 20, 2003 4:17 pm
by tecton
*sigh*

Posted: Sat Dec 20, 2003 8:34 pm
by DuFF
I've never heard of this error message. After a little searching this was the only thing I could find on it. Could you please supply a little more info? Is there a line it's pointing to that's causing the error? Can you post the code that's giving you the problems?
I'd like to point out a _major_ pitfall some Windows users might experience while trying to send or receive data from a server when using fsockopen() and fwrite()

Your PHP parser probably _won't_ insert a carriage return and newline when using this sort of method for writing a request:

fwrite($fp,<<<PING
POST /RPC2 HTTP/1.0\r
Host: rpc.weblogs.com\r
User-Agent: My Pinger version f00\r
Content-Length: 233\r
Content-Type: text/xml\r
\r
$myping\r
PING
);

This will resolve a "Bad Request" error from most servers, or even worse, no response at all, causing a less-careful script to hang indefinitely. To ensure a carriage return followed by a newline, use this method:

fwrite($fp,
"POST /R

Posted: Sun Dec 21, 2003 3:13 am
by tecton
when i attempt to post to $PHP_SELF

Posted: Sun Dec 21, 2003 9:44 am
by DuFF
Try using $_SERVER['PHP_SELF'] instead.