feedback form

Hello everyone
I am working on a feedback form for a web site. Php script collects data from forms on the page and emails them using mail function. Everything works fine except for form . I can not get the selected value into the script. I do not know whether there is certain way to do that.
Any help is appreciated.

Comments

  • [b][red]This message was edited by Moderator at 2005-10-31 3:48:29[/red][/b][hr]
    Could you post the code you're using so we can analyze what you've already done.


    --=][tReShR][=--



  • Here is the select form in html

    Select one
    First Option
    Second Option
    Third Option
    Fourth Option
    Fifth Option
    Sixth Option
    Seventh Option
    Other


    Here is the php code

    <?php
    $lname = $_POST['lname'];
    $fname = $_POST['fname'];
    $org = $_POST['org'];
    $email = $_POST['email'];
    $pnumber = $_POST['pnumber'];
    $service = $POST['service'];
    $message = $_POST['comments'];
    $formcontent="FIRST NAME: $fname

    LAST NAME: $lname

    ORGANIZATION: $org

    PHONE NUMBER: $pnumber

    SERVICE: $service

    FEEDBACK: $message";
    $recipient = "something@somewhere.com";
    $subject = "Contact Form ";
    $mailheader = "From: $email
    ";
    $mailheader .= "Reply-To: $email
    ";
    $mailheader .= "MIME-Version: 1.0
    ";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!");
    ?>

    I think that my problem is in calling $service into $formcontent variable.
    Solution seems to be easy, but I am just not much in web programming.




  • Actually thats not the problem. When using the select u have to specify a 'value' property for each 'option' e.g.

    First Option
    Second Option
    ...etc etc


    : Here is the select form in html
    :
    : Select one
    : First Option
    : Second Option
    : Third Option
    : Fourth Option
    : Fifth Option
    : Sixth Option
    : Seventh Option
    : Other
    :
    :
    : Here is the php code
    :
    : <?php
    : $lname = $_POST['lname'];
    : $fname = $_POST['fname'];
    : $org = $_POST['org'];
    : $email = $_POST['email'];
    : $pnumber = $_POST['pnumber'];
    : $service = $POST['service'];
    : $message = $_POST['comments'];
    : $formcontent="FIRST NAME: $fname

    LAST NAME: $lname

    ORGANIZATION: $org

    PHONE NUMBER: $pnumber

    SERVICE: $service

    FEEDBACK: $message";
    : $recipient = "something@somewhere.com";
    : $subject = "Contact Form ";
    : $mailheader = "From: $email
    ";
    : $mailheader .= "Reply-To: $email
    ";
    : $mailheader .= "MIME-Version: 1.0
    ";
    : mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!");
    : ?>
    :
    : I think that my problem is in calling $service into $formcontent variable.
    : Solution seems to be easy, but I am just not much in web programming.
    :
    :
    :
    :
    :

  • A little thing that might help you in debugging your code...

    print_r( $_REQUEST ) ;
    or, instead of $_REQUEST, use $_GET, $_POST, or whatever else... You may use even your own arrays. This may help you in locating any future problems.

    : Actually thats not the problem. When using the select u have to specify a 'value' property for each 'option' e.g.
    :
    : First Option
    : Second Option
    : ...etc etc
    :
    :
    : : Here is the select form in html
    : :
    : : Select one
    : : First Option
    : : Second Option
    : : Third Option
    : : Fourth Option
    : : Fifth Option
    : : Sixth Option
    : : Seventh Option
    : : Other
    : :
    : :
    : : Here is the php code
    : :
    : : <?php
    : : $lname = $_POST['lname'];
    : : $fname = $_POST['fname'];
    : : $org = $_POST['org'];
    : : $email = $_POST['email'];
    : : $pnumber = $_POST['pnumber'];
    : : $service = $POST['service'];
    : : $message = $_POST['comments'];
    : : $formcontent="FIRST NAME: $fname

    LAST NAME: $lname

    ORGANIZATION: $org

    PHONE NUMBER: $pnumber

    SERVICE: $service

    FEEDBACK: $message";
    : : $recipient = "something@somewhere.com";
    : : $subject = "Contact Form ";
    : : $mailheader = "From: $email
    ";
    : : $mailheader .= "Reply-To: $email
    ";
    : : $mailheader .= "MIME-Version: 1.0
    ";
    : : mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!");
    : : ?>
    : :
    : : I think that my problem is in calling $service into $formcontent variable.
    : : Solution seems to be easy, but I am just not much in web programming.
    : :
    : :
    : :
    : :
    : :
    :
    :


    /* No Comment */

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories