WordPress.org

Ready to get started?Download WordPress

Forums

Form on Page to Email (6 posts)

  1. justinshattuck
    Member
    Posted 7 years ago #

    I've created a small form within my single page template that is..

    <?php
    if ($post->ID == 46) {
    ?>
    <div class="form">
    <form method="post" action="" enctype="">
    <div class="formleft">
    <label for="store_number">Store Number: </label>
    </div>
    <div class="formright"><input type="text" name="store_number" size="30" maxlength="50" value="" /> (required)</div>
    <div class="formleft">
    <label for="quantity">Quantity:</label>
    </div>
    <div class="formright"><select name="qty" value="">
    <option value="1">1 set</option>
    <option value="2">2 sets</option>
    <option value="3">3 sets</option>
    <option value="4">4 sets</option>
    <option value="5">5 sets</option>
    </select>
    </div>
    <div class="formleft">
    <label for="upcharge">Upcharge:</label>
    </div>
    <div class="formright"><input type="text" name="upcharge" size="30" maxlength="100" value="" />
    (if applicable)
    </div>
    <div class="formleft"><label for="special_instructions">Special Instructions: </label></div>

    <div class="formright"><textarea name="special" cols="35" rows="8" value=""></textarea></div>
    <div class="formright"><input type="submit" name="Submit" value="Submit" id="contactsubmit" /></div>
    </form>
    </div>

    I'm wanting to take this form and create a form-mailer to have it emailed to me once its been populated and filled out. Could anyone give me some suggestions on best way? I'm using a contact form already on the site and I played with Dagon's plugin but its just too crazy for this..

    Assistance appreciated!

  2. Michael_
    Member
    Posted 7 years ago #

    You need to make sure spammers/hackers have no chance to abuse your form. Contact forms are frequently hacked.
    Make sure *every* variable is being checked that comes via $_POST to avoid hacking.

    You can check appropriate sites in the web that provide php code for contact forms, e.g. hotscripts.com. Also, there are several plugins available for WordPress, see http://codex.wordpress.org/Plugins or http://www.wp-plugins.net/.

    But read the comments on the plugin's pages, AFAIK were there some plugins for contact forms that have been hacked in the past.

  3. justinshattuck
    Member
    Posted 7 years ago #

    As mentioned, I am not needing the form to be for contact. I already have a contact form and the site is 100% closed to the public, you must login to view the blog. I am wanting to add this form to my page, I already built the form, I just need to get the php code to actually email the populated fields to a designated email address, very simple validation. Make sure there is a store number inserted, and it consists of three to five numerics, on alphas. That is it, anything else is optional for the user to insert.

    Suggestions?

  4. justinshattuck
    Member
    Posted 7 years ago #

    Someone, please help!!!!

  5. justinshattuck
    Member
    Posted 7 years ago #

    bump, any help?

  6. solutionsphp
    Member
    Posted 7 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags