Results 1 to 2 of 2

Thread: noob question, how to: php mailer

  1. #1
    google Guest

    noob question, how to: php mailer

    Ok i need your help.

    I am a bit of a noob in the web realm and i was wondering what is the easiest way to create a php emailer that returns the values from 1. text fields 2. drop down selections 3. radio buttons ... i have created a php mailer that returns the values of text fields but i am unsure of drop downs and radio buttons....

    I am using dreamweaver

    any advice, easy tutorials etc. would be appreciated..

  2. #2
    Join Date
    Feb 2009
    Location
    Monroe, NY
    Posts
    33
    Hi,
    Getting the value from a dropdown passed to a PHP script is the same as getting the value from a text input passed to the PHP script. Make sure that in the HTML in the opening select tag you declare a name (ex: <select name="color">). Then give each option a value (ex: <option value="blue">Blue</option>). What PHP will see as the value of $_POST['color'] will be the value of the option selected. If you have a group of radio buttons, give each the same name. Assign them different values.
    Example:
    Code:
    <input type="radio" name="sign_up" value="yes_signup" />Yes<br />
    <input type="radio" name="sign_up" value="no_signup" />No<br />
    In your PHP code, to get the radio button the person selected, use $_POST['sign_up']. If the user selected the first radio, the value of $_POST['sign_up'] would be "yes_signup". You can read more about PHP forms at http://www.w3schools.com/php/php_forms.asp.

Posting Permissions

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