Title: Adding Custom Form w/php
Last modified: August 19, 2016

---

# Adding Custom Form w/php

 *  [skellish](https://wordpress.org/support/users/skellish/)
 * (@skellish)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/adding-custom-form-wphp/)
 * I would like to add a page to my site containing fields generated using embedded
   HTML and parsed and stored in a database using PHP. I’m not looking for help 
   creating the HTML/PHP, just for the proper way to do this in WordPress. Can I
   just embedded the html/php when I add the page? This is going to be a single 
   page, so I didn’t think I needed to create a template.
 * I want the page to both generate the fields and process them depending on whether
   the form as been submitted or not by testing a hidden “submitted” field. Can 
   I just reference the permalink in the action attribute like so:
 * <form action=”[http://www.savenjnow.com/softsys/?page_id=16&#8243](http://www.savenjnow.com/softsys/?page_id=16&#8243);
   method=”post”>
 * Thanks
    Scott

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

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/adding-custom-form-wphp/#post-1222933)
 * > Can I just embedded the html/php when I add the page?
 * No, not by default. PHP embedded in pages, posts and text-widgets doesn’t execute.
   [ExecPHP](http://wordpress.org/extend/plugins/exec-php/) will change that, though.
 * > This is going to be a single page, so I didn’t think I needed to create a template.
 * I’d make a template if it were me. If nothing else, it makes the code easy to
   find and to edit.
 * > Can I just reference the permalink in the action attribute…
 * If the same page is processing the request you can leave the form `action=""`,
   at least if you do it with a template.
 *  [tsalagi](https://wordpress.org/support/users/tsalagi/)
 * (@tsalagi)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/adding-custom-form-wphp/#post-1223248)
 * Did you get this to work? If so do you mind posting an example. I’d like to do
   the same or something similar.

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

The topic ‘Adding Custom Form w/php’ is closed to new replies.

## Tags

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

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 2 replies
 * 3 participants
 * Last reply from: [tsalagi](https://wordpress.org/support/users/tsalagi/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/adding-custom-form-wphp/#post-1223248)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
