Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2007
    Posts
    28

    Unanswered: Feedback Form Code Needed

    hello, i am developing a feedback form. i need some assistance with the PHP CODE..

    here is the form code for the HTML page or u can say the feedback form page.

    form can be found on this page..
    http://ioc.us.com/contact%20us.htm

    <form method="POST" action="_derived/nortbots.htm" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit language="JavaScript" name="FrontPage_Form1" webbot-action="--WEBBOT-SELF--">
    <!--webbot bot="SaveResults" U-File="_private/inforeq.htm" S-Format="TEXT/TSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE" S-Email-Format="TEXT/PRE" S-Email-Address="info@ioc.us.com" B-Email-Label-Fields="TRUE" S-Date-Format="%d %b %Y" S-Time-Format="%H:%M:%S" S-Builtin-Fields="REMOTE_NAME Date Time" startspan --><strong>[FrontPage Save Results Component]</strong><!--webbot bot="SaveResults" i-checksum="6561" endspan -->
    <p align="center"><b>IOC Dallas Office, USA</b>: <br>
    13606TI Blvd,
    Dallas, Texas 75243<b><br>
    <br>

    Questions or comments email us at: <br>
    </b> General Information: <a href="mailto:info@ioc.us.com">
    <!--webbot
    bot="Substitution" s-variable="CompanyEmail" startspan -->info@ioc.us.com<!--webbot bot="Substitution" i-checksum="39001" endspan --></a><br>
    Sales: <a href="mailto:sales@ioc.us.com">sales@ioc.us.com</a><br>
    Customer Support: <a href="mailto:cs@ioc.us.com">cs@ioc.us.com</a></p>

    <h3>Comments</h3>
    <blockquote>
    <p><textarea name="Comments" rows="10" cols="45"></textarea> </p>
    </blockquote>
    <h3>Category</h3>
    <blockquote>

    <p><select name="Category">
    <option selected>Web site</option>
    <option>Company</option>


    <option>Products</option>


    <option>Services</option>


    </select> </p>
    </blockquote>
    <h3>Contact Information</h3>
    <!--mstheme--></font><table>
    <tr><td align="right"><!--mstheme--><font face="arial, Arial, Helvetica"><em>Name</em><!--mstheme--></font></td><td><!--mstheme--><font face="arial, Arial, Helvetica">
    <!--webbot bot="Validation" S-Data-Type="String" B-Allow-Letters="TRUE" B-Allow-WhiteSpace="TRUE" --><input name="Name" value size="35"><!--mstheme--></font></td></tr>

    <tr><td align="right"><!--mstheme--><font face="arial, Arial, Helvetica"><em>Company</em><!--mstheme--></font></td><td><!--mstheme--><font face="arial, Arial, Helvetica"><input type="TEXT" name="Company" value size="35"><!--mstheme--></font></td></tr>
    <tr><td align="right"><!--mstheme--><font face="arial, Arial, Helvetica"><em>Address</em><!--mstheme--></font></td><td><!--mstheme--><font face="arial, Arial, Helvetica"><input type="TEXT" name="Address" value size="35"><!--mstheme--></font></td></tr>
    <tr><td align="right"><!--mstheme--><font face="arial, Arial, Helvetica"><em>Telephone</em><!--mstheme--></font></td><td><!--mstheme--><font face="arial, Arial, Helvetica"><input type="TEXT" name="Telephone" value size="35"><!--mstheme--></font></td></tr>
    <tr><td align="right"><!--mstheme--><font face="arial, Arial, Helvetica"><em>FAX</em><!--mstheme--></font></td><td><!--mstheme--><font face="arial, Arial, Helvetica"><input type="TEXT" name="FAX" value size="35"><!--mstheme--></font></td></tr>
    <tr><td align="right"><!--mstheme--><font face="arial, Arial, Helvetica"><em>E-mail</em><!--mstheme--></font></td><td><!--mstheme--><font face="arial, Arial, Helvetica"><input type="TEXT" name="Email" value size="35"><!--mstheme--></font></td></tr>
    </table><!--mstheme--><font face="arial, Arial, Helvetica">
    <p><input type="submit" value="Submit Feedback"> <input
    type="RESET" value="Reset Form"> </p>
    </form>
    can anybody provide me with the code..which i can use to send this info on a certain email address...

    something like this maybe

    <?php
    $yourmail = "webmaster@valuestudies.com"; // put your e-mail here
    $t1 = $_POST['name'];
    $t2 = $_POST['email'];
    $t3 = $_POST['subject'];
    $t4 = $_POST['body'];
    $data = "Name: $t1\nEmail: $t2\nSubject: $t3\nMessage: $t4\n";
    mail ($yourmail, "Contact Us Form", $data); // The Form mean subject of mail you will receive
    ?>

  2. #2
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    That looks just fine to me. Consider using the fields from your html page though instead of the ones that seem to be default in that script.
    i.e.
    Code:
    <?php
    $yourmail = "webmaster@valuestudies.com"; // put your e-mail here
    
    $email = $_POST['Email'];
    $name = $_POST['Name'];
    $company = $_POST['Company'];
    $address = $_POST['Address'];
    $fax = $_POST['FAX'];
    
    $data = "Name: $name\nEmail: $email\nCompany: $company\nAddress: $address\nFax: $fax";
    
    mail ($yourmail, "Contact Us Form", $data); // The Form mean subject of mail you will receive
    ?>

  3. #3
    Join Date
    Mar 2007
    Posts
    28
    Thanks but wt would be the code for drop down list menu..?

  4. #4
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    To display the dropdown menu or to grab the option you selected to input it into the email?

    Take a guess, and let me know what you think, and i'll let you know if you're right or not. Intuition and the near complete example i provided for you already should lead you to the correct solution.

  5. #5
    Join Date
    Mar 2007
    Posts
    28
    basically i am talking abt radio buttions..like a few options are given in a Radio button form or Drop Down list form and when somebody ticks or select one of them..it is sent in the email that this was the option which was chosen by the person while using the feedback form.

  6. #6
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    Ok, i see what you're saying:
    I was asking whether you wanted to dynamically create a dropdown box, populating all the values inside it.
    Or
    Whether you wanted to grab the information selected in the dropdown box.

    I realise it is the latter of the two.

    However, I will state what I stated before. What has been provided is nearly complete. I am trying to encourage you to work out how to put in those last couple of bits.
    In order to help you achieve this I suggest you look at what I have written for you already. Find where the values are coming from, and then utilise the same methods previously applied.

    We're here to help, not to do all your work for you

  7. #7
    Join Date
    Mar 2007
    Posts
    28
    sir i definitely know that you are here to help and i appreciate...i provided you with the code and you corrected it for me.. i was talking abt "I was asking whether you wanted to dynamically create a dropdown box, populating all the values inside it." ... i just asked you..how to make that dropdown box working ..

  8. #8
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    I realise the question are you asking. You want to know how you get the value that you have selected from the dropdown box and use that inside your email.
    What i'm saying is that it follows the same principle as all the other values you are getting.

    How do you get the value you posted from an input box?
    The answer is the same for a dropdown box.

    Write what you "think" it is and then i'll help you out some more.

  9. #9
    Join Date
    Jul 2006
    Posts
    56
    hey man, aschk has provided everything you need. but here, go ahead, copy and paste:

    HTML Code:
    <select name="whatever_name_you_want" >
      <option value="value_for_selected" selected="selected">Text do Display on List Menu</option>
      <option value="another_value" >Another Text do Display on List Menu</option>
      <option value="yer_another_value" >Yet Another Text do Display on List Menu</option>
    </select>
    and so on ... notice the selected="selected" ? Use it only if you want a default value to be selected.

    to get that value, use either one of these:
    PHP Code:
    $value_from_select $_POST["whatever_name_you_want"];
    $value_from_select $_REQUEST["whatever_name_you_want"]; 
    $_REQUEST contains data from these collections: $_GET, $_POST, and $_COOKIE .

    Read some about PHP ...
    http://www.w3schools.com/php

    Best Regards!

Posting Permissions

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