Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 4 of 4
  1. #1

    Join Date
    Feb 2006
    Location
    Canada
    Posts
    3,079
    DNF$
    248
    Bank
    1,508
    Total DNF$
    1,755
    Donate  

    Sendmail.php help

    I am building a simple contact form and wondering if i could get some help.

    I want it to be a series of questions

    form.html

    <form method="post" action="sendmail.php">
    Name: <input name="name" type="text" /><br />
    Email Address: <input name="email" type="text" /><br />
    Question 1:<br />
    <textarea name="q1" rows="15" cols="40">
    </textarea><br />
    Question 2:<br />
    <textarea name="q2 rows="15" cols="40">
    </textarea><br />
    <input type="submit" />
    </form>


    what does the sendmail.php have to look like i am having trouble getting this to work. i have tried a few things.

    <?php
    $name = $_REQUEST['name'] ;
    $email = $_REQUEST['email'] ;
    $q1 = $_REQUEST['q1'] ;
    $q2 = $_REQUEST['q2'] ;

    mail( "my@emailaddress.com", "Feedback Form",
    $message, "From: $email" );

    ?>


    Thanks in advance

  2. #2
    .scot
    ftaylor's Avatar
    Join Date
    Apr 2008
    Location
    Glasgow
    Posts
    473
    DNF$
    4,580
    Bank
    0
    Total DNF$
    4,580
    Donate  
    Your form method is "post". This means that all data passed by the form to sendmail.php will be in the $_POST array.

    Try

    Code:
    $name = $_POST['name'];
    further, if this is to be used on a live/production website, sendmail.php should NOT be as simple as that - you will have to sanitize and validate all of the user entered data.
    www.musicdownloads.tv for sale, taking offers.

  3. #3

    Join Date
    Feb 2006
    Location
    Canada
    Posts
    3,079
    DNF$
    248
    Bank
    1,508
    Total DNF$
    1,755
    Donate  
    Quote Originally Posted by ftaylor View Post
    Your form method is "post". This means that all data passed by the form to sendmail.php will be in the $_POST array.

    Try

    Code:
    $name = $_POST['name'];
    further, if this is to be used on a live/production website, sendmail.php should NOT be as simple as that - you will have to sanitize and validate all of the user entered data.

    Thanks, i will give that a shot. this form will be in a protected area of a website with a few trusted people having access.

    Thanks,

  4. #4
    .scot
    ftaylor's Avatar
    Join Date
    Apr 2008
    Location
    Glasgow
    Posts
    473
    DNF$
    4,580
    Bank
    0
    Total DNF$
    4,580
    Donate  
    Feel free to PM me with any other PHP (and web tech) related questions - I'd be happy to help.
    www.musicdownloads.tv for sale, taking offers.

Bookmarks

Posting Permissions

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

Domain name forum recommended by Domaining.com