Contact form help!

Discussion in 'HTML & Website Design' started by moodey-aimee, Jul 27, 2010.

  1. #1
    Hey, i wanted to make a contact me, page for my website design, and i was wondering if someone could help me. I know how to Do, the mailto link.

    But i wanted like a page on my site where you can write the email on the site, when click sumbit, then it comes to my email address is that possible to do with html?
    if anyone could help that would be great, it would make my contact page look a little more better looking on my website design.
     
    moodey-aimee, Jul 27, 2010 IP
  2. I'm Taz

    I'm Taz Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There's a lot of tutorial on how to create a stylish contact form..
    One of the example is : http:// tutorialzine.com/2009/09/fancy-contact-form/

    p/s : remove the space between http:// and tutorialzine.. =)
     
    Last edited: Jul 27, 2010
    I'm Taz, Jul 27, 2010 IP
  3. hes

    hes Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    this is easy with php
     
    hes, Jul 27, 2010 IP
  4. Thorlax402

    Thorlax402 Member

    Messages:
    194
    Likes Received:
    2
    Best Answers:
    5
    Trophy Points:
    40
    #4
    This is quite simple in php thanks to the "mail()" function.

    The first thing you need to do is create a form with HTML so the user can input the information they want (email address, subject, message, etc.). When you submit the form, you will be able to get the user's input with the variable "$_POST['varname']" in php. Then you can use the mail() function to send the email with the information gotten from the user.

    mail($email, $subject, $message);
    Code (markup):
     
    Thorlax402, Jul 27, 2010 IP
  5. moodey-aimee

    moodey-aimee Guest

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    So what i made a form in Html first, like

    To:
    Subject:
    Content:

    do u have any coding??
     
    moodey-aimee, Jul 28, 2010 IP
  6. Ricechen

    Ricechen Peon

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Your idea is correct, so you can put people visit your site to find you a better
     
    Ricechen, Jul 28, 2010 IP
  7. moodey-aimee

    moodey-aimee Guest

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    but how to i code it? and Nice avatar btw ^^
     
    moodey-aimee, Jul 28, 2010 IP
  8. REBOOTTHAT

    REBOOTTHAT Guest

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hi,

    Who is your website host and what technology are you using? PHP, .Net, etc.
     
    REBOOTTHAT, Jul 28, 2010 IP
  9. moodey-aimee

    moodey-aimee Guest

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    My site is on webs.com
     
    moodey-aimee, Jul 28, 2010 IP
  10. Thorlax402

    Thorlax402 Member

    Messages:
    194
    Likes Received:
    2
    Best Answers:
    5
    Trophy Points:
    40
    #10
    A form will have a layout similar to this:

    
    <!-- This will set our form to post the data of the input fields to "something.php". -->
    <form method="post" action="something.php">
        <!-- This will output the text "Your email:" and then give an input box asking for the users email address. We must give the input a name so that we can call it from our processing page. -->
        Your email: <input type="text" name="email" />
    
        <!-- We repeat the process for all the inputs we want. -->
        Subject: <input type="text" name="subject" />
    
        <!-- We use the textarea tag instead of input because it provides a large, scrolling box for the user to type longer messages in. Again, it still needs a name like the inputs. -->
        Message: <textarea name="message"></textarea>
    
        <!-- And of course a submit button. The contents of the "value" option is what the button will say on it. -->
        <input type="submit" value="Send" />
    </form>
    
    HTML:
    This form will post the given information to a file defined by the action in the form. In this case we called it "something.php".

    something.php
    
    <?php
    $email = "Your_email@something.com";     // This is where you want the emails to go to. Meaning your email address.
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    // Here we can give the headers of the email, meaning we can define who the email is from.
    $headers = "From: ".$_POST['email'];
    
    // Send the email.
    mail($email, $subject, $message, $headers);
    ?>
    
    PHP:

    Hope this helps.
     
    Thorlax402, Jul 29, 2010 IP
  11. moodey-aimee

    moodey-aimee Guest

    Messages:
    152
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    moodey-aimee, Aug 4, 2010 IP
  12. generationeXt

    generationeXt Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    contact form can b implemented only by php..

    and ur server must support mail sending via contact form.. otherwise it wont work..

    u can either convert it into a php page (just save it as pagename.php) u will get the script for contact form online.. try using google.. go thru the code.. it is pretty simple to understand...
     
    generationeXt, Aug 4, 2010 IP
  13. Thorlax402

    Thorlax402 Member

    Messages:
    194
    Likes Received:
    2
    Best Answers:
    5
    Trophy Points:
    40
    #13
    I literally just gave you exactly what you need word for word with comments on what everything means. Please just spend two seconds trying to understand the code and you will have exactly what you were looking for.
     
    Thorlax402, Aug 6, 2010 IP