Forums

Adding Custom Form w/php (3 posts)

  1. skellish
    Member
    Posted 2 years ago #

    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" method="post">

    Thanks
    Scott

  2. apljdi
    Member
    Posted 2 years ago #

    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 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.

  3. Tsalagi
    Member
    Posted 2 years ago #

    Did you get this to work? If so do you mind posting an example. I'd like to do the same or something similar.

Topic Closed

This topic has been closed to new replies.

About this Topic