Submitting to a database (help!)

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
mpho
Forum Newbie
Posts: 1
Joined: Fri Jul 12, 2002 8:21 am
Contact:

Submitting to a database (help!)

Post by mpho »

Im writing code for a message board system and get the following error when trying to submits postings:

HTTP Error 405:

405 Method not allowed.

The Method specified in the Request Line is not allowed for the resource identified by the request. Please ensure that you have the proper MIME type set up for the resource you are requesting.

I'm posting as follows:

<FORM method=post action="<?php echo PHP_SELF ?>">

Please Help
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Hmmm? Based on your code, I'm suprised you're not seeing a parse error as I don't see a ";" on the end of that echo.

Is there a way to verify that PHP_SELF is being properly echo'ed in the HMTL? Look at the source before pressing the submit button and see what form tag looks like.

Hope that helps,
BDKR (TRC)
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Post by RandomEngy »

Try $PHP_SELF and $_SERVER['PHP_SELF'] instead of PHP_SELF.
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

BDKR wrote:Hmmm? Based on your code, I'm suprised you're not seeing a parse error as I don't see a ";" on the end of that echo.

Is there a way to verify that PHP_SELF is being properly echo'ed in the HMTL? Look at the source before pressing the submit button and see what form tag looks like.

Hope that helps,
BDKR (TRC)
The last line within any <?PHP ?> tags does not require a ;

Try it yourself, take off the very last ; in any of your scripts, but having said that I think it good programming pratice to include all ;

Mike
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

That is strange! I never would've thought that.

But oh well.....

Later on,
BDKR
Post Reply