Forum Moderators: phranque

Message Too Old, No Replies

When someone tries to GET your POST page

         

Tonearm

2:31 pm on Sep 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Whenever a form is POSTed on my site, the resultant page in the address bar is always "/posted". Sometimes a user will bookmark this "page" or try to GET it in another fashion, and they are met with my standard 404 page. I can't think of a better way to handle this. Has anyone else?

physics

6:16 pm on Sep 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think the best way would be to alter the code so that you use GET on pages that people want to (and should be able to) bookmark. Short of that you could set something up so that if someone gets to the /posted page and the POST info is empty then display a custom error page explaining that they can't bookmark these sorts of pages...

jomaxx

7:49 pm on Sep 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it's a "thank you" kind of page, why not redirect to the homepage instead? But I agree with the previous poster, use GET whenever it makes sense. I often see pages that I want to either bookmark or link to, and can't because the developer used POST for some reason.

kaled

11:25 am on Sep 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Presumably, the posted page was generated from a form on another page - rather than generate a 404, why not redirect the user to the other page. You could even use ?postedfrom=anotherpage.php in your urls. This could even work with multi-level forms (that use different urls) but you should ensure that the redirect goes straight to the first form in the chain rather than using multiple redirects.

Kaled.

Tonearm

4:29 pm on Sep 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Good ideas, thanks guys.