Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've got a simple custom page template with a form on it. This page can process the form itself, so the entered data gets submitted there as well, using POST. Submitting the form, however, results in a 404 in my blog's regular theme (default template). If I leave out all of the data entry elements in the form, so I'll be submitting an entry form, it somehow works.

You can use this code to reproduce the error if you want to see for yourself.

Any suggestions as to what could be wrong are much appreciated, thanks!

share|improve this question
    
Here's the firebug report on what POST data is being submitted: i.imgur.com/cFKoV.png –  Chris Jan 21 '12 at 17:07
add comment

2 Answers

up vote 1 down vote accepted

You need to change:

<form action="index.php" method="post">

to:

<form action="" method="post"> 

I'm guessing that this is just a test case, but be sure that your final template has calls to wp_head and wp_footer in there.

share|improve this answer
    
Thank you so much! This problem really bugged me and I couldn't figure it out what was causing it. Really glad you've found out how to fix it! P.S: Just a test case indeed :). –  Chris Jan 22 '12 at 15:50
add comment

Are you using any of the wordpress reserved words in your html form? If yes that will give you a 404 page error when submitting.

http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms

share|improve this answer
    
Thanks for the link, but due to the prefix present in the code of my first post, I don't think I do - unless I'm misreading or forgetting something. –  Chris Jan 21 '12 at 17:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.