PHP feedback form help - newb

Discussion in 'HTML' started by Paul Gunson, Feb 13, 2004.

  1. Paul Gunson

    Paul Gunson Guest

    i've got a very basic feedback form working thanks to an online
    tutorial, using sendmail.php.

    my sendmail.php below basically sends a form of two selection boxes and
    a textarea for additional comments. it sends me mail ok but the order of
    the information as it appears in the e-mail seems to be random... eg,
    how do i get select1 to appear first, then select 2, then a line break
    and the textbox last...? the current layout makes select2 appear first,
    then the textbox, line break, and select1 last. i've tried other layouts
    but they either don't send the textbox or result in an error....

    <?
    $select1 = $_REQUEST['select1'];
    $select2 = $_REQUEST['select2'];
    $textbox = $_REQUEST['textbox'];

    mail( "", "Online survey",
    "$textbox\n Site looks: $select1", "Connection speed: $select2" );
    header( "Location: /thankyou.html" );
    ?>

    any help for an html ignoramus greatly apprec.
    Paul Gunson, Feb 13, 2004
    #1
    1. Advertising

  2. Paul Gunson

    Paul Furman Guest

    Paul Gunson wrote:
    > i've got a very basic feedback form working thanks to an online
    > tutorial, using sendmail.php.
    >
    > my sendmail.php below basically sends a form of two selection boxes and
    > a textarea for additional comments. it sends me mail ok but the order of
    > the information as it appears in the e-mail seems to be random... eg,
    > how do i get select1 to appear first, then select 2, then a line break
    > and the textbox last...? the current layout makes select2 appear first,
    > then the textbox, line break, and select1 last. i've tried other layouts
    > but they either don't send the textbox or result in an error....
    >
    > <?
    > $select1 = $_REQUEST['select1'];
    > $select2 = $_REQUEST['select2'];
    > $textbox = $_REQUEST['textbox'];
    >
    > mail( "", "Online survey",
    > "$textbox\n Site looks: $select1", "Connection speed: $select2" );
    > header( "Location: /thankyou.html" );
    > ?>




    Here's your mail statement (more readable):

    mail(
    "",
    "Online survey",
    "$textbox\n Site looks: $select1",
    "Connection speed: $select2" );


    You want to compose the message body with the three variables so first
    do this:
    $message-body =
    ."Site looks: ".$select1
    ."\nConnection speed: ".$select2
    ."\n".$textbox;

    The dot is a string concatenator, variables don't need to be quoted,
    notice the commas below and semicolon at the end of each statement. I
    think the newline "\n" is a string.


    Then, I think the format is:
    mail(
    "",
    $subject,
    $message-body);

    If you have errors, you can do:
    $mailerror = mail(as shown above)
    then:
    echo $mailerror
    to debug it.


    The manual in this case is not very helpful, it's usually much much more
    clear. If you scroll down, there are good examples though.
    http://us2.php.net/manual/en/ref.mail.php
    Paul Furman, Feb 14, 2004
    #2
    1. Advertising

  3. Paul Gunson

    Paul Gunson Guest

    Paul Gunson, Feb 14, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. isaac2004
    Replies:
    4
    Views:
    364
    =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=
    Oct 4, 2007
  2. Rajive Narain
    Replies:
    0
    Views:
    1,668
    Rajive Narain
    Sep 18, 2009
  3. Mindful_Spirit
    Replies:
    2
    Views:
    365
    Mindful_Spirit
    Jul 14, 2004
  4. Gieljan de Vries

    Visitor feedback via forms without ASP/PHP?

    Gieljan de Vries, Feb 22, 2004, in forum: Javascript
    Replies:
    1
    Views:
    122
    Michael Winter
    Feb 22, 2004
  5. Replies:
    4
    Views:
    183
Loading...

Share This Page