Web Analytics Made Easy -
StatCounter I not getting my drop down menu in php - CodingForum

Announcement

Collapse
No announcement yet.

I not getting my drop down menu in php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • I not getting my drop down menu in php

    Hello Iam building instant mail message for my page... The only thing iam not getting is my dropp down menu section (Interseted) don't know why ?

    Here is my html code:

    Code:
    <font color="#ffffff">INTERESTS:</font><br>
    
    <select id="Interested" size="1" title="Interested " name="Interested" style="height: 25px; width: 210px; font-size: 14px; vertical-align: middle; background-color:#ffffff; text-transform: capitalize;">
    
    <option value="">Choose Option</option>
    <option value="Business Card Design">Business Card Design</option>
    <option value="Flyer Design">Flyer Design</option>
    <option value="Logo Design">Logo Design</option>
    <option value="Web Design">Web Design</option>
    <option value="Photography">Photography</option>
    <option value="Social Website Design">Social Website Design </option>
    <option value="Photography">Photography</option>
    <option value="Videography wedding">Videography wedding </option>
    <option value="Sweet Sixteens">Sweet Sixteens</option>
    <option value="Music Videos">Music Videos</option>
    <option value="Tv Commercial Production">Tv Commercial Production</option>
    <option value="Artist Biography">Artist Biography</option>
    <option value="Special Events">Special Events</option>
    
    
        </select>	
    	<br>
    Here is my PHP Code


    PHP Code:
    <?php 
    // EDIT THE 2 LINES BELOW AS REQUIRED 
    $email_to "[email protected]"
    $email_subject "Hello"

    function 
    died($error) { 
    // your error code can go here 
    echo "We are very sorry, but there were error(s) found with the form you submitted. "
    echo 
    "These errors appear below.<br /><br />"
    echo 
    $error."<br /><br />"
    echo 
    "Please go back and fix these errors.<br /><br />"
    die(); 


    $full_name $_POST['FullName']; // required 
    $email $_POST['Email']; // required 
    $phone $_POST['Phone']; // required 
    $postal_code $_POST['PostalCode']; // required 
    $interested $_POST['Interested']; // required 
     
    $comments =  $_POST['Your_Message'];
     
        
    $email_message "Form details below.\n\n";
     
        function 
    clean_string($string) {
          
    $bad = array("content-type","bcc:","to:","cc:","href");
          return 
    str_replace($bad,"",$string);
        }

    $email_message .= "Full Name: ".clean_string($full_name)."\n"
    $email_message .= "Email: ".clean_string($email)."\n"
    $email_message .= "Phone: ".clean_string($phone)."\n"
    $email_message .= "Postal Code': ".clean_string($postal_code)."\n"
    $email_message .= "Interested: ".clean_string($interested)."\n"
    $email_message .= "Comments: ".clean_string($comments)."\n"

    // create email headers 
    $headers 'From: '.$email_from."\r\n"
    'Reply-To: '.$email_from."\r\n" 
    'X-Mailer: PHP/' phpversion(); 
    @
    mail($email_to$email_subject$email_message$headers); 
    ?> 

    <!-- include your own success html here --> 

    Thank you for contacting us. We will be in touch with you very soon.
    Here is how Form Look in my email:

    Form details below.

    Full Name: john
    Email: [email protected]
    Phone: 4164258695
    Postal Code': m3c1e6
    Interested:
    Comments: hello just testing..
    Last edited by Inigoesdr; Aug 26, 2011, 03:30 PM.

  • #2
    You are showing no action for your select tag. So no action is taken. Either the <select> is by itself and you call a javascript function or it's in a form and the form determines the action.

    Select
    http://www.w3schools.com/tags/tag_select.asp

    form
    http://www.w3schools.com/tags/tag_form.asp
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.

    Comment


    • #3
      I didn't understand you well what you mean by Select Action ???

      Comment


      • #4
        Did you read the pages I sent you? If you did you should know what I mean. Your select tag needs to have an action assigned to it. Yours don't so no action taken.
        Evolution - The non-random survival of random variants.
        Physics is actually atoms trying to understand themselves.

        Comment


        • #5
          Okay I do have action assigned and also the select tag to ? take a look below


          <form name="contactform" method="post" action="http://www.mxstudio.ca/instantrequestemail.php">

          <font color="#ffffff">INTERESTS:</font><br>
          <select id="Interestedin" size="1" title="Interestedin " name="Interestedin" style="height: 25px; width: 210px; font-size: 14px; vertical-align: middle; background-color:#ffffff; text-transform: capitalize;">
          <option value="">Choose Option</option>
          <option value="Business Card Design">Business Card Design</option>
          <option value="Flyer Design">Flyer Design</option>
          <option value="Logo Design">Logo Design</option>
          <option value="Web Design">Web Design</option>
          <option value="Photography">Photography</option>
          <option value="Social Website Design">Social Website Design </option>
          <option value="Photography">Photography</option>
          <option value="Videography wedding">Videography wedding </option>
          <option value="Sweet Sixteens">Sweet Sixteens</option>
          <option value="Music Videos">Music Videos</option>
          <option value="Tv Commercial Production">Tv Commercial Production</option>
          <option value="Artist Biography">Artist Biography</option>
          <option value="Special Events">Special Events</option>


          </select>
          <br>



          <input type="submit" value=" Submit Form ">
          </form>


          This is what I get in my email form

          Form details below.

          Full Name: john
          Email: [email protected]
          Phone: 4164258695
          Postal Code': m3c1e6
          Interested:
          Comments: just testing thank you

          Iam missing Interseted section Don't know why ????
          Last edited by mursallo; Aug 27, 2011, 03:23 PM.

          Comment


          • #6
            These two blocks have different names for your select. Which is it, Interested or Interestedin? The PHP code suggests it should be named Interested.
            PHP Code:
            header('HTTP/1.1 420 Enhance Your Calm'); 
            Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

            Comment


            • #7
              Hello Fou-Lu thanks for helping me okay after you pointed me I got two different block names okay I changed to Interseted like php below I pasted it the code. but I still don't get the box menu in my email for the interseted.

              html code

              <font color="#ffffff">INTERESTS:</font><br>
              <select id="Interested" size="1" title="Interested" name="Interested" style="height: 25px; width: 210px; font-size: 14px; vertical-align: middle; background-color:#ffffff; text-transform: capitalize;">
              <option value="">Choose Option</option>
              <option value="Business Card Design">Business Card Design</option>
              <option value="Flyer Design">Flyer Design</option>
              <option value="Logo Design">Logo Design</option>
              <option value="Web Design">Web Design</option>
              <option value="Photography">Photography</option>
              <option value="Social Website Design">Social Website Design </option>
              <option value="Photography">Photography</option>
              <option value="Videography wedding">Videography wedding </option>
              <option value="Sweet Sixteens">Sweet Sixteens</option>
              <option value="Music Videos">Music Videos</option>
              <option value="Tv Commercial Production">Tv Commercial Production</option>
              <option value="Artist Biography">Artist Biography</option>
              <option value="Special Events">Special Events</option>


              </select>
              <br>



              Form details below.

              Full Name: john
              Email: [email protected]
              Phone: 4164258695
              Postal Code': m3c1e6
              Interested:
              Comments: just testing thank you...

              Comment


              • #8
                Post all of your HTML and PHP code. Also make sure they are placed in php or code tags.
                PHP Code:
                header('HTTP/1.1 420 Enhance Your Calm'); 
                Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

                Comment


                • #9
                  Okay here is my HTML CODE

                  <form name="contactform" method="post" action="http://www.mxstudio.ca/instantrequestemail.php">
                  <font color="#ffffff">FULL NAME</font><br>
                  <input style="background-color:#ffffff; height: 25px; width: 210px; font-size: 14px; vertical-align: middle; text-transform: capitalize;" maxlength="150" title="Full Name" name="FullName" id="FullName" type="text">
                  <br>

                  <font color="#ffffff">EMAIL</font><br>
                  <input style="background-color:#ffffff; height: 25px; width: 210px; font-size: 14px; vertical-align: middle;" maxlength="150" title="Email Address" name="Email" id="Email" type="text">
                  <br>

                  <font color="#ffffff">PHONE</font><br>
                  <input style="background-color:#ffffff; height: 25px; width: 210px; font-size: 14px; vertical-align: middle; text-transform: capitalize;" maxlength="150" title="Phone Number" name="Phone" id="Phone" type="text">
                  <br>

                  <font color="#ffffff">POSTAL CODE</font><br>
                  <input style="background-color:#ffffff; height: 25px; width: 210px; font-size: 14px; vertical-align: middle; text-transform: capitalize;" maxlength="150" title="Postal Code" name="PostalCode" id="PostalCode" type="text">
                  <br>






                  <font color="#ffffff">INTERESTS:</font><br>
                  <select id="Interested" size="1" title="Interested" name="Interested" style="height: 25px; width: 210px; font-size: 14px; vertical-align: middle; background-color:#ffffff; text-transform: capitalize;">
                  <option value="">Choose Option</option>
                  <option value="Business Card Design">Business Card Design</option>
                  <option value="Flyer Design">Flyer Design</option>
                  <option value="Logo Design">Logo Design</option>
                  <option value="Web Design">Web Design</option>
                  <option value="Photography">Photography</option>
                  <option value="Social Website Design">Social Website Design </option>
                  <option value="Photography">Photography</option>
                  <option value="Videography wedding">Videography wedding </option>
                  <option value="Sweet Sixteens">Sweet Sixteens</option>
                  <option value="Music Videos">Music Videos</option>
                  <option value="Tv Commercial Production">Tv Commercial Production</option>
                  <option value="Artist Biography">Artist Biography</option>
                  <option value="Special Events">Special Events</option>


                  </select>
                  <br>


                  <font color="#ffffff">COMMENTS:</font><br>
                  <textarea style="width:210px;height:100px; font-size: 14px; vertical-align: middle; background-color:#ffffff; text-transform: capitalize;" name="Your_Message" id="Your_Message" maxlength="2000"></textarea>
                  <br><br>


                  <input type="submit" value=" Submit Form ">
                  </form>
                  </td>
                  </tr>
                  <tr>
                  <td width="252" height="33"></td>
                  </tr>
                  <tr>
                  <td width="252" height="9" align="center">
                  <img src="/images/trans-bottom-shadingv.png" width="242" height="9" border="0">
                  </td>
                  </tr>
                  </tbody></table>



                  AND HERE IS MY PHP CODE


                  <?php
                  // EDIT THE 2 LINES BELOW AS REQUIRED
                  $email_to = "[email protected]";
                  $email_subject = "Hello";


                  function died($error) {
                  // your error code can go here
                  echo "We are very sorry, but there were error(s) found with the form you submitted. ";
                  echo "These errors appear below.<br /><br />";
                  echo $error."<br /><br />";
                  echo "Please go back and fix these errors.<br /><br />";
                  die();
                  }


                  $full_name = $_POST['FullName']; // required
                  $email = $_POST['Email']; // required
                  $phone = $_POST['Phone']; // required
                  $postal_code = $_POST['PostalCode']; // required
                  $interested = $_POST['Interested']; // required
                  $comments = $_POST['Your_Message'];




                  $email_message = "Form details below.\n\n";

                  function clean_string($string) {
                  $bad = array("content-type","bcc:","to:","cc:","href");
                  return str_replace($bad,"",$string);
                  }


                  $email_message .= "Full Name: ".clean_string($full_name)."\n";
                  $email_message .= "Email: ".clean_string($email)."\n";
                  $email_message .= "Phone: ".clean_string($phone)."\n";
                  $email_message .= "Postal Code': ".clean_string($postal_code)."\n";
                  $email_message .= "Interested: ".clean_string($interested)."\n";

                  $email_message .= "Comments: ".clean_string($comments)."\n";


                  // create email headers
                  $headers = 'From: '.$email_from."\r\n".
                  'Reply-To: '.$email_from."\r\n" .
                  'X-Mailer: PHP/' . phpversion();
                  @mail($email_to, $email_subject, $email_message, $headers);
                  ?>

                  <!-- include your own success html here -->

                  Thank you for contacting us. We will be in touch with you very soon.

                  Comment


                  • #10
                    The only error in my test indicates that you have an undefined variable called email_from.

                    I otherwise receive the populated option in my output text as expected. Of course, if you choose nothing and leave it as the default option, then it will come empty.

                    Also, as mentioned more than once, ensure all your code is wrapped in [php][/php] or [code][/code] tags.
                    PHP Code:
                    header('HTTP/1.1 420 Enhance Your Calm'); 
                    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

                    Comment


                    • #11
                      PHP Code:
                      // EDIT THE 2 LINES BELOW AS REQUIRED 
                      $email_to "[email protected]"
                      $email_subject "Hello"


                      function 
                      died($error) { 
                      // your error code can go here 
                      echo "We are very sorry, but there were error(s) found with the form you submitted. "
                      echo 
                      "These errors appear below.<br /><br />"
                      echo 
                      $error."<br /><br />"
                      echo 
                      "Please go back and fix these errors.<br /><br />"
                      die(); 



                      $full_name $_POST['FullName']; // required 
                      $email $_POST['Email']; // required 
                      $phone $_POST['Phone']; // required 
                      $postal_code $_POST['PostalCode']; // required 
                      $interested $_POST['Interested']; // required 
                       
                      $comments =  $_POST['Your_Message'];
                       
                       
                          
                         
                          
                      $email_message "Form details below.\n\n";
                       
                          function 
                      clean_string($string) {
                            
                      $bad = array("content-type","bcc:","to:","cc:","href");
                            return 
                      str_replace($bad,"",$string);
                          }


                      $email_message .= "Full Name: ".clean_string($full_name)."\n"
                      $email_message .= "Email: ".clean_string($email)."\n"
                      $email_message .= "Phone: ".clean_string($phone)."\n"
                      $email_message .= "Postal Code': ".clean_string($postal_code)."\n"
                      $email_message .= "Interested: ".clean_string($interested)."\n"

                      $email_message .= "Comments: ".clean_string($comments)."\n"


                      // create email headers 
                      $headers 'From: '.$email_from."\r\n"
                      'Reply-To: '.$email_from."\r\n" .             [COLOR="Red"]I HAVE TO CHANGE THIS TO MY EMAIL ???[/COLOR]
                      'X-Mailer: PHP/' phpversion(); 
                      @
                      mail($email_to$email_subject$email_message$headers); 
                      <!-- include your own success html here -->

                      Thank you for contacting us. We will be in touch with you very soon.



                      DID i PUT THE WRAPPED CODE RIGHT OR NO...CUZ I PUT IT LAST TIME IT SHOW ME ERROR DON'T KNOW WHY ??...
                      Last edited by mursallo; Aug 28, 2011, 05:30 PM.

                      Comment


                      • #12
                        Originally posted by mursallo View Post
                        PHP Code:
                        // EDIT THE 2 LINES BELOW AS REQUIRED 
                        $email_to "[email protected]"
                        $email_subject "Hello"


                        function 
                        died($error) { 
                        // your error code can go here 
                        echo "We are very sorry, but there were error(s) found with the form you submitted. "
                        echo 
                        "These errors appear below.<br /><br />"
                        echo 
                        $error."<br /><br />"
                        echo 
                        "Please go back and fix these errors.<br /><br />"
                        die(); 



                        $full_name $_POST['FullName']; // required 
                        $email $_POST['Email']; // required 
                        $phone $_POST['Phone']; // required 
                        $postal_code $_POST['PostalCode']; // required 
                        $interested $_POST['Interested']; // required 
                         
                        $comments =  $_POST['Your_Message'];
                         
                         
                            
                           
                            
                        $email_message "Form details below.\n\n";
                         
                            function 
                        clean_string($string) {
                              
                        $bad = array("content-type","bcc:","to:","cc:","href");
                              return 
                        str_replace($bad,"",$string);
                            }


                        $email_message .= "Full Name: ".clean_string($full_name)."\n"
                        $email_message .= "Email: ".clean_string($email)."\n"
                        $email_message .= "Phone: ".clean_string($phone)."\n"
                        $email_message .= "Postal Code': ".clean_string($postal_code)."\n"
                        $email_message .= "Interested: ".clean_string($interested)."\n"

                        $email_message .= "Comments: ".clean_string($comments)."\n"


                        // create email headers 
                        $headers 'From: '.$email_from."\r\n"
                        'Reply-To: '.$email_from."\r\n" .             [COLOR="Red"]I HAVE TO CHANGE THIS TO MY EMAIL ???[/COLOR]
                        'X-Mailer: PHP/' phpversion(); 
                        @
                        mail($email_to$email_subject$email_message$headers); 
                        <!-- include your own success html here -->

                        Thank you for contacting us. We will be in touch with you very soon.



                        DID i PUT THE WRAPPED CODE RIGHT OR NO...CUZ I PUT IT LAST TIME IT SHOW ME ERROR DON'T KNOW WHY ??...
                        I don't understand what you are referring to.
                        PHP Code:
                        header('HTTP/1.1 420 Enhance Your Calm'); 
                        Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

                        Comment


                        • #13
                          Okay sorry for getting you lost where do you want me to change variables email_form the one you reminded me???? ....and also for the wrapped code do I put this code before <?php or after on the top right.....thanks


                          // create email headers
                          $headers = 'From: '.$email_from."\r\n".
                          'Reply-To: '.$email_from."\r\n" . IS IS A VARIABLES RU TALKING ABOUT ???
                          'X-Mailer: PHP/' . phpversion();
                          @mail($email_to, $email_subject, $email_message, $headers);

                          Comment


                          • #14
                            You can do whatever you want with it. All I'm saying is you are using a variable that doesn't exist; I don't know what you want to go into that Reply-To address.
                            Code tags go around the entirety of the code.
                            PHP Code:
                            header('HTTP/1.1 420 Enhance Your Calm'); 
                            Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

                            Comment


                            • #15
                              Okay should I take off the variables of the code or should I put my email Address there?? ...thanks 'Reply-To: '[email protected]"\r\n"


                              [ php ]
                              <?php


                              code on the middle right


                              ?>
                              [ / php ]
                              Last edited by mursallo; Aug 28, 2011, 07:09 PM.

                              Comment

                              Working...
                              X