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.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need help with simple email form

    Please help. Below works, but that is only with message.

    How do I add name, address, city so they work and are included in email.
    New to php and everything I try does not get work.

    Thanks


    < ?
    $email = $_GET['email'] ;
    $message = $_GET['message'] ;
    mail( "yourname@example.com", "Email Subject", $message, "From: $email" );
    print "Congratulations your email has been sent";
    ?>

  • #2
    New Coder
    Join Date
    Oct 2006
    Posts
    82
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I would set the form method="post" and where the message goes put something along the lines of...

    PHP Code:

    <?php

    $email 
    $_POST['email'] ;
    $message $_POST['message'] ;
    $name $_POST['name'];
    $address $_POST['address'];
    $city $_POST['city'];

    mail"yourname@example.com""Email Subject"$name."<br/>".$address."<br/>".$city."<br/><br/>".$message"From: $email" );
    print 
    "Congratulations your email has been sent";

    ?>
    Alternatively you could use /n for line breaks within the code. It's really up to you.

  • #3
    New to the CF scene
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you so much!!


  •  

    Posting Permissions

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