Help with coding problem please

Discussion in 'HTML & Website Design' started by Ritaj, Dec 8, 2009.

  1. #1
    Hi

    I am trying to set up a website where I want people to input
    their information, ie name etc., but instead of using an
    autoresponder, I would like to informationt to be sent
    directly to an email address when they hit submit.

    Can someone give me the coding to do this with two places
    for the input of information.

    Your help would be greatly appreciated.

    Ritaj
     
    Ritaj, Dec 8, 2009 IP
  2. danramosd

    danramosd Active Member

    Messages:
    115
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    83
    #2
    I would recommend using the PHP mail function. To do this you would set up your html form that you want to use and sent it to a php file to handle the actual email. In this example you have a php file that has a regular form. The form calls the same file and the php handles the information sent:
    <!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">
    <!--filename: index.php-->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>

    <body>

    <?php

    $firstname=$_GET['$firstname'];
    $lastname=$_GET['lastname'];

    $message="First name:".$firstname." Last name: ".$lastname;


    mail('your@email.com', 'Subject line is here', $message);




    ?>
    <form id="form1" name="form1" method="post" action="index.php">
    <p>
    <label>firstname
    <input type="text" name="firstname" id="firstname" />
    </label>
    <br />
    <label>lastname
    <input type="text" name="lastname" id="lastname" />
    </label>
    </p>

    <input type="submit" name="submit" id="submit" value="Submit" />

    </form>
    <p>

    </p>
    </body>
    </html>


    Let me know if you still have any questions. I normally answer questions quicker on twitter @danramosd or through email dan[at]motionpaused[dot]com
     
    danramosd, Dec 8, 2009 IP
  3. Wp-Mod.Com

    Wp-Mod.Com Peon

    Messages:
    381
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    rather install wordpress and make a page and use contact form 7 , highly customizable and , wordpress makes it easy for you to customize it adn change the way it looks coz there are thousands o themes out there .
     
    Wp-Mod.Com, Dec 8, 2009 IP