Custom Form and 404 Error
-
Hi
I’m brand new to WordPress so excuse the basic questions ?? I am trying to add a contact form to a page. I want to do this manually rather than using a plugin mainly as I’m just trying to get my head around the whole process. Initially I want to avoid custom templates and just add a form into a standard page. I am pretty much working from the post at https://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/.
So far I have added a plugin that allows me to run PHP code on a page. The code I have added simply contains the PHP command…
require_once(ABSPATH. '/wp-content/custom-php/p2.php');
p2.php conatins the following…
<form method="POST" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> <div> <label for="name">name</label> <input type="text" name="name" id="name" /> </div> <input type="submit" value="go" /> </form>
If I go to my site and access this page it opens up and shows the form so the include is working … so far so good. If I click on the submit button with nothing in the input field then everything is still happy. The minute I put some text into the input field and click submit I get a 404 Page Not Found error. Can someone please suggest what might be going on?
Thanks
Alan
- The topic ‘Custom Form and 404 Error’ is closed to new replies.