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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tecton
Forum Newbie
Posts: 22
Joined: Sat Dec 20, 2003 1:58 am
Contact:

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

Post by tecton »

i keep getting this error

using latest version of xitami and php windows xp
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

tecton
Forum Newbie
Posts: 22
Joined: Sat Dec 20, 2003 1:58 am
Contact:

Post by tecton »

no that doesnt help
tecton
Forum Newbie
Posts: 22
Joined: Sat Dec 20, 2003 1:58 am
Contact:

Post by tecton »

if someone knows the answer to this please help
tecton
Forum Newbie
Posts: 22
Joined: Sat Dec 20, 2003 1:58 am
Contact:

Post by tecton »

*sigh*
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post 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
tecton
Forum Newbie
Posts: 22
Joined: Sat Dec 20, 2003 1:58 am
Contact:

Post by tecton »

when i attempt to post to $PHP_SELF
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

Try using $_SERVER['PHP_SELF'] instead.
Post Reply