+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
Coding Thread, drop down list in a html webform and php in Coding and Web Development; Originally Posted by Uraken hi shane thanks that works now although it returns it at the bottom like this: How ...
  1. #16
    Shane's Avatar
    Join Date
    Apr 2007
    Location
    Kernow
    Posts
    166
    Thank Post
    23
    Thanked 14 Times in 12 Posts
    Rep Power
    21
    Quote Originally Posted by Uraken View Post
    hi shane thanks that works now although it returns it at the bottom like this:

    How many Beds =
    How many large Boxes = 3
    How many wardrobes = 3
    How many pianos = 3
    How many small boxes = 3
    Email Address = a@bc.com
    Any other info here please = fsgdf

    How many beds:2

    p.s if i have more than one drop down can i assume i repeat the syntax with the new select id?

    thanks again

    You will also need a new name variable for the new select element (So in the first drop down box the name is 'people' this will have to be different in a new one as this is what the $_POST uses)

    So you would like the 'How many beds' information at the top of the email yeah?

    Try this:

    //begin code

    // Only show error messages, not the warnings...
    ini_set("error_reporting", "E_ALL & ~E_NOTICE");

    // E-mail address to which the form will be sent...
    $form_email = "email@email.com";

    if ($_POST['envoi']) {

    // E-mail headers:
    $headers ="MIME-Version: 1.0 \n";
    $headers .="From: website\n";


    $headers .="Content-Type: text/html; charset=iso-8859-1 \n";

    $subject = "Enqu iryFrom website";

    $header_part = "


    ";

    $text_fields_part = "
    How many bed:".stripslashes($_POST['people'])."
    ";

    for ($a=1; $a<= $_POST['text_field_number']; $a++) {
    $text_fields_part .= "" . $_POST['field_title'.$a] . " = " . $_POST['field'.$a] . "
    ";
    }

    if ($_POST['email_field_number'] != 0) {
    $email_field_part = "" . $_POST['email_title'] . " = " . $_POST['email_field'] . "
    ";
    }

    if ($_POST['textarea_number'] != 0) {
    $text_area_field = "" . $_POST['textarea_title'] . " = " . $_POST['textarea_field'] . "
    ";
    $text_area_field = stripslashes($text_area_field);
    }


    $end = "";

    $output = $header_part . $text_fields_part . $email_field_part . $text_area_field . $end;

    // Send the e-mail
    if (@!mail($form_email,$subject,$output,$headers)) {
    echo("Cannot send the form");
    } else { // Closing if !mail...

    // Redirect to the thank you page
    header("Location:thankyou.html");
    exit();

    } // Fin du else
    } // Closing if edit
    ?>


    Untitled Document

































    How many Beds
    How many large Boxes
    How many wardrobes
    How many pianos
    How many small boxes
    Email Address
    Any other info here please












    //end code

    Again sorry I can't test it (sorry I keep on editing this post, keep seeing things that I need to change)
    Last edited by Shane; 5th March 2008 at 12:09 PM.

  2. #17

    Join Date
    Oct 2006
    Location
    uk
    Posts
    494
    Thank Post
    19
    Thanked 3 Times in 2 Posts
    Rep Power
    17
    thanks for that shane i understand it now. The last code did not work so i reverted back i will have to make do with it where it is thanks again for your help.

  3. #18
    Shane's Avatar
    Join Date
    Apr 2007
    Location
    Kernow
    Posts
    166
    Thank Post
    23
    Thanked 14 Times in 12 Posts
    Rep Power
    21
    Quote Originally Posted by Uraken View Post
    thanks for that shane i understand it now. The last code did not work so i reverted back i will have to make do with it where it is thanks again for your help.
    No worries

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Webform reply to address
    By HodgeHi in forum Web Development
    Replies: 2
    Last Post: 24th November 2007, 02:52 PM
  2. Cisco to Drop Linksys Brand
    By FN-GM in forum IT News
    Replies: 6
    Last Post: 1st August 2007, 08:21 PM
  3. PHP, MySQL, Webform, idiots guide.
    By Quackers in forum Coding
    Replies: 2
    Last Post: 5th June 2007, 08:03 AM
  4. Drop your messenger addys in here
    By Kyle in forum General Chat
    Replies: 22
    Last Post: 17th February 2007, 02:57 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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