Need a email form done..

Discussion in 'HTML & Website Design' started by 5ive, Dec 6, 2009.

  1. #1
    Hi guys, I have no idea how to do this so im asking for help and if this is a simple thing for you, remember im not a coder at all so bare with me. :)


    I have a form on in my design that i got from the coder that coded my design, and it looks like this at the moment. And i want it to send a email to my email address when ever the form is used, can some one please help me and show me how I can do that. Thank you


    <table width="300" border="0">
      <tr>
        <td width="156" style="text-align: left"><div align="left">Your Name:</div></td>
        <td width="310" align="left"><div align="left">
          <input name="" type="text" style="width: 240px;"/>
        </div></td>
      </tr>
      <tr>
        <td style="text-align: left;"><div align="left">Your Email Address:</div></td>
        <td><div align="left">
          <input name="input" type="text" style="width: 240px;"/>
        </div></td>
      </tr>
      <tr>
        <td valign="top" style="text-align: left;"><div align="left">Your Message:</div></td>
        <td><div align="left">
          <textarea name="textarea" cols="20" rows="10" style="width: 240px;"></textarea><br /><br />
          <input name="button1" type="button" value="Send it!" />
        </div></td>
      </tr>
    </table>
    HTML:

     
    5ive, Dec 6, 2009 IP
  2. hillord

    hillord Well-Known Member

    Messages:
    2,211
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    140
    #2
    u miss out on the emailto
     
    hillord, Dec 6, 2009 IP
  3. 5ive

    5ive Well-Known Member

    Messages:
    1,348
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    185
    #3
    Well i know some code is missing and thats confusing me since im not a coder i dont know where to ad what, I can edit as long as the code is there :p

    I assume im looking for some one that can add/edit missing code
     
    5ive, Dec 6, 2009 IP
  4. PcProbs

    PcProbs Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    what does the form do right now when you send it?
     
    PcProbs, Dec 6, 2009 IP
  5. 5ive

    5ive Well-Known Member

    Messages:
    1,348
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    185
    #5
    At the moment it doesnt do anything when you send it.
     
    5ive, Dec 6, 2009 IP
  6. jonathandey

    jonathandey Active Member

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Okay here is what you have to do.
    Copy and paste this where your old one used to be:
    
    <form name="email" method="post" action="">
    <table width="300" border="0">
      <tr>
        <td width="156" style="text-align: left"><div align="left">Your Name:</div></td>
        <td width="310" align="left"><div align="left">
          <input name="name" type="text" style="width: 240px;"/>
        </div></td>
      </tr>
      <tr>
        <td style="text-align: left;"><div align="left">Your Email Address:</div></td>
        <td><div align="left">
          <input name="input" type="text" style="width: 240px;"/>
        </div></td>
      </tr>
      <tr>
        <td valign="top" style="text-align: left;"><div align="left">Your Message:</div></td>
        <td><div align="left">
          <textarea name="textarea" name="message" cols="20" rows="10" style="width: 240px;"></textarea><br /><br />
          <input name="button1" type="submit" value="Send it!" />
        </div></td>
      </tr>
    </table>
    </form>
    
    HTML:
    Now you have to add the PHP to do this go to the top of the page that contains the message form and add this code:
    
    <?
     
    if ($_POST['button1']){
    	$name = strip_tags($_POST['name']);
    	$email = $_POST['input'];
    	$message = strip_tags($_POST['message']);
    	$myemail = 'you@youremail.com';
    	$header = "from: $name <$email>"; 
     
    	mail($myemail, $subject, $message, $header);
     
    	echo "Message Sent";
    }
    
    ?>
    
    HTML:
    Hope this helps if not drop me an email at jonathan@n33t.co.uk.
    I don't know who coded this for you but they haven't done a very good job.
     
    jonathandey, Dec 7, 2009 IP
    5ive likes this.
  7. 5ive

    5ive Well-Known Member

    Messages:
    1,348
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    185
    #7


    Thank you so much, Im at work now but I will do this as soon as I get back home. Im not blaming the coder because he was just supposed to do a PSD to XHTML job and he did a good job I think, this is something extra.. Thank you once again for taking your time to help me out.
     
    5ive, Dec 7, 2009 IP
  8. jonathandey

    jonathandey Active Member

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #8
    Okay fair enough he did a good job then :p
    No problem, if you need anymore help just ask :)
     
    jonathandey, Dec 7, 2009 IP
  9. Gatux

    Gatux Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Oh I was gonna help you :p
    You got it though.
     
    Gatux, Dec 7, 2009 IP
  10. iLinkMarket.com

    iLinkMarket.com Peon

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you can't get it to work properly or ever get hung up again on forms there is a great place call mycontactform that has copy paste web based form creation for people that lack code experience. I used them a long time ago before I knew how..
     
    iLinkMarket.com, Dec 7, 2009 IP