Title: Custom Form and 404 Error
Last modified: August 19, 2016

---

# Custom Form and 404 Error

 *  [Alan](https://wordpress.org/support/users/arr/)
 * (@arr)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/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 [http://www.badlydrawntoy.com/2009/10/07/how-to-run-custom-php-code-in-wordpress-the-right-way/](http://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

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/custom-form-and-404-error/#post-1810436)
 * If you want to use this an an exercise to understand WP, then I’m afraid you 
   will, effectively, have to write your own plugin. I’d suggest starting with [Writing_a_Plugin](http://codex.wordpress.org/Writing_a_Plugin).
 *  Thread Starter [Alan](https://wordpress.org/support/users/arr/)
 * (@arr)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/custom-form-and-404-error/#post-1810438)
 * Thanks Esmi. I didn’t really want to get that involved though :s At this stage
   all I really want to do is understand how to successfully enable a post back.
 *  Thread Starter [Alan](https://wordpress.org/support/users/arr/)
 * (@arr)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/custom-form-and-404-error/#post-1810457)
 * Blimey I fixed it… WP doesn’t seem to like it when I use name=”name” for the 
   input tag. I changed it to name=”uname” and it now works. What a waste of a day!!
   Why didn’t I google earlier :s
 * [http://wordpress.org/support/topic/contact-form-404-error?replies=8](http://wordpress.org/support/topic/contact-form-404-error?replies=8)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom Form and 404 Error’ is closed to new replies.

## Tags

 * [custom form](https://wordpress.org/support/topic-tag/custom-form/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Alan](https://wordpress.org/support/users/arr/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/custom-form-and-404-error/#post-1810457)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
