Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    New Coder
    Join Date
    Mar 2013
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile New to this...Need A Form [Code]

    New to this.....

    I am trying to make a form. I need it with basic info like name, email etc...I also want check boxes, and I would like the form information to come to my email. I was wondering if anyone could help with a code that I could use. I also need php code to go along with it.

    Thank you for your time,
    Have a blessed day :-) <><+

  • #2
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    721
    Thanks
    20
    Thanked 84 Times in 84 Posts
    forms themselves arnt really php

    but i guess the email part is.

    if you are going to make the form, please post it here,

    if you need someone to make the form for you post ALL the fields you want here
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • Users who have thanked Arcticwarrio for this post:

    Marifran (03-17-2013)

  • #3
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,180
    Thanks
    23
    Thanked 603 Times in 602 Posts
    Read this page http://www.quackit.com/html/codes/ht...m_to_email.cfm

    Have a blessed day :-) <><+ And that's an order!

  • Users who have thanked sunfighter for this post:

    Marifran (03-17-2013)

  • #4
    New Coder
    Join Date
    Mar 2013
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile form page

    The fields are:
    Event date
    name
    email
    city

    Check boxes:
    What type of event? (checkboxes)
    Birthday
    Business
    Weddings

    What type of food? (Checkboxes)
    Vegan
    Traditional
    Gluten free

    Additional comment box




    Quote Originally Posted by Arcticwarrio View Post
    forms themselves arnt really php

    but i guess the email part is.

    if you are going to make the form, please post it here,

    if you need someone to make the form for you post ALL the fields you want here

  • #5
    New Coder
    Join Date
    Mar 2013
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile Thank You

    Thank you very much. <><+

    Quote Originally Posted by sunfighter View Post
    Read this page http://www.quackit.com/html/codes/ht...m_to_email.cfm

    Have a blessed day :-) <><+ And that's an order!







  • #6
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    721
    Thanks
    20
    Thanked 84 Times in 84 Posts
    PHP Code:
    <?php
    if (isset($_POST['email_address'])){
    // Load form field data into variables.
    $email_address $_POST['email_address'] ;
    $comments $_POST['comments'] ;

    mail"yourname@example.com""Event Form",
     
    "Comments ".$comments."<BR>
     Date: "
    $_POST['date']."<BR>
     name: "
    $_POST['name']."<BR>
     Email: "
    $email_address."<BR>
     <BR>
     Event type: "
    $_POST['Birthday']."<BR>
     Event type: "
    $_POST['Business']."<BR>
     Event type: "
    $_POST['Wedding']."<BR>"
    "From: $email_address" );
    echo 
    'Thank you for your event request, we will be in touch soon.';

    }
    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Event Form</title>    
    </head>
    <body>
    <h1>Fill in the form and hit send to email us</h1>
    <form action="" method="post">
    <table>
    <tr>
    <td>Event Date:</td>
    <td><input type="text" name="date" value="" maxlength="100" /></td>
    </tr>

    <tr>
    <td>Your Name:</td>
    <td><input type="text" name="name" value="" maxlength="100" /></td>
    </tr>

    <tr>
    <td>Email Address:</td>
    <td><input type="text" name="email_address" value="" maxlength="100" /></td>
    </tr>

    <tr>
    <td>Event type:</td>
    <td>Birthday <input type="checkbox" name="Birthday" value"Birthday"/></td>
    </tr>

    <tr>
    <td>Business <input type="checkbox" name="Business" value"Business"/></td>
    <td>Wedding <input type="checkbox" name="Wedding" value"Wedding"/></td>
    </tr>

    <tr>
    <td>Comments:</td>
    <td><textarea rows="10" cols="50" name="comments"></textarea></td>
    </tr>

    <tr><td>&nbsp;</td>
    <td>
    <input type="submit" value="Send" />
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    Last edited by Arcticwarrio; 03-18-2013 at 08:49 PM.
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • #7
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    721
    Thanks
    20
    Thanked 84 Times in 84 Posts
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • #8
    New Coder
    Join Date
    Mar 2013
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you for your help, but the code didn't work. i copied and pasted it correctly into both areas. I see the form but the comment line is all code instead of a box and when I press submit button everything gets reset but nothing goes to my email. ( i did add my email to the code) so I'm not sure why it isn't working. Can you please help. Thank you.

    Quote Originally Posted by Arcticwarrio View Post
    PHP Code:
    <?php
    if (isset($_POST['email_address'])){
    // Load form field data into variables.
    $email_address $_POST['email_address'] ;
    $comments $_POST['comments'] ;

    mail"yourname@example.com""Event Form",
     
    "Comments ".$comments."<BR>
     Date: "
    $_POST['date']."<BR>
     name: "
    $_POST['name']."<BR>
     Email: "
    $email_address."<BR>
     <BR>
     Event type: "
    $_POST['Birthday']."<BR>
     Event type: "
    $_POST['Business']."<BR>
     Event type: "
    $_POST['Wedding']."<BR>"
    "From: $email_address" );
    echo 
    'Thank you for your event request, we will be in touch soon.';

    }
    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Event Form</title>    
    </head>
    <body>
    <h1>Fill in the form and hit send to email us</h1>
    <form action="" method="post">
    <table>
    <tr>
    <td>Event Date:</td>
    <td><input type="text" name="date" value="" maxlength="100" /></td>
    </tr>

    <tr>
    <td>Your Name:</td>
    <td><input type="text" name="name" value="" maxlength="100" /></td>
    </tr>

    <tr>
    <td>Email Address:</td>
    <td><input type="text" name="email_address" value="" maxlength="100" /></td>
    </tr>

    <tr>
    <td>Event type:</td>
    <td>Birthday <input type="checkbox" name="Birthday" value"Birthday"/></td>
    </tr>

    <tr>
    <td>Business <input type="checkbox" name="Business" value"Business"/></td>
    <td>Wedding <input type="checkbox" name="Wedding" value"Wedding"/></td>
    </tr>

    <tr>
    <td>Comments:</td>
    <td>&lt;textarea rows="10" cols="50" name="comments"&gt;&lt;/textarea&gt;</td>
    </tr>

    <tr><td>&nbsp;</td>
    <td>
    <input type="submit" value="Send" />
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

  • #9
    New Coder
    Join Date
    Mar 2013
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you for your help but the code didn't work for me. I copied and pasted both codes in proper areas and changed email to my own. But on the form in the comment box it shows code instead of a box and when i click on submit it deletes everything as if it were sent, but nothing shows up in my email.

    Thank you again please help!!

    Quote Originally Posted by Marifran View Post
    The fields are:
    Event date
    name
    email
    city

    Check boxes:
    What type of event? (checkboxes)
    Birthday
    Business
    Weddings

    What type of food? (Checkboxes)
    Vegan
    Traditional
    Gluten free

    Additional comment box




  • #10
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    721
    Thanks
    20
    Thanked 84 Times in 84 Posts
    i've edited post 6 to fix the errors
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • #11
    New Coder
    Join Date
    Mar 2013
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Still Stuck

    Thank you the comment box is now corrected but when I click the submit button everything just gets deleted and there is no notification that it was sent. Also I still am not receiving anything in my email and I did put my email in the code. Thank you again help! :/

  • #12
    New Coder
    Join Date
    Mar 2013
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Can anyone help with this code. I am new to forums and not sure if anyone can even see this. Thank you.

  • #13
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,180
    Thanks
    23
    Thanked 603 Times in 602 Posts
    Arcticwarrio code in post 6 works with one problem. It throws up errors for the check boxes. I fixed it in code below. But you need to make sure yhe form does not go blank, That the echo 'Thank you for your event request, we will be in touch soon.'; occurs in a better place (at the bottom and in color) ... Both should be done by stopping the html from exicuting the second time... And you have no checks in here to stop spamming.

    So a good start on what you need is :
    Code:
    <?php
    if (isset($_POST['email_address'])){
    	(isset($_POST["Birthday"]) ? $Birthday = "Birthday" : $Birthday = "");  /*  NEXT 3 LINES ADDED  */
    	(isset($_POST["Business"]) ? $Business = "Business" : $Business = "");
    	(isset($_POST["Wedding"]) ? $Wedding = "Wedding" : $Wedding = "");
    // Load form field data into variables.
    $email_address = $_POST['email_address'] ;
    $comments = $_POST['comments'] ;
    
    mail("yourname@example.com", "Event Form",
    "Comments " . $comments . "<BR>
     Date: " . $_POST["date"] . "<BR>
     name: " . $_POST["name"] . "<BR>
     Email: " . $email_address . "<BR>
     <BR>
     Event type: " . $Birthday."". $Business."". $Wedding . "<BR>"    /*  THIS HAS BEEN CHANGED   */
    , "From: $email_address" );
    echo 'Thank you for your event request, we will be in touch soon.';
    }
    ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Event Form</title>
    </head>
    <body>
    <h1>Fill in the form and hit send to email us</h1>
    <form action="" method="post">
    <table>
    <tr>
    <td>Event Date:</td>
    <td><input type="text" name="date" value="" maxlength="100" /></td>
    </tr>
    
    <tr>
    <td>Your Name:</td>
    <td><input type="text" name="name" value="" maxlength="100" /></td>
    </tr>
    
    <tr>
    <td>Email Address:</td>
    <td><input type="text" name="email_address" value="" maxlength="100" /></td>
    </tr>
    
    <tr>
    <td>Event type:</td>
    <td>Birthday <input type="checkbox" name="Birthday" value"Birthday"/></td>
    </tr>
    
    <tr>
    <td>Business <input type="checkbox" name="Business" value"Business"/></td>
    <td>Wedding <input type="checkbox" name="Wedding" value"Wedding"/></td>
    </tr>
    
    <tr>
    <td>Comments:</td>
    <td><textarea rows="10" cols="50" name="comments"></textarea></td>
    </tr>
    
    <tr><td>&nbsp;</td>
    <td>
    <input type="submit" value="Send" />
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

  • #14
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    721
    Thanks
    20
    Thanked 84 Times in 84 Posts
    this is a learning forum, not a do everything for me forum
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  • #15
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,180
    Thanks
    23
    Thanked 603 Times in 602 Posts
    Quote Originally Posted by Arcticwarrio View Post
    this is a learning forum, not a do everything for me forum
    Meaning?


  •  
    Page 1 of 2 12 LastLast

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •