Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 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 "mursallotest@gmail.com"
    $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: mursallotest@gmail.com
    Phone: 4164258695
    Postal Code': m3c1e6
    Interested:
    Comments: hello just testing..
    Last edited by Inigoesdr; 08-26-2011 at 07:30 PM.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,290
    Thanks
    23
    Thanked 611 Times in 610 Posts
    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

  • #3
    New Coder
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I didn't understand you well what you mean by Select Action ???

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,290
    Thanks
    23
    Thanked 611 Times in 610 Posts
    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.

  • #5
    New Coder
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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: mursallotest@gmail.com
    Phone: 4164258695
    Postal Code': m3c1e6
    Interested:
    Comments: just testing thank you

    Iam missing Interseted section Don't know why ????
    Last edited by mursallo; 08-27-2011 at 07:23 PM.

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    These two blocks have different names for your select. Which is it, Interested or Interestedin? The PHP code suggests it should be named Interested.

  • #7
    New Coder
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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: spanish_boy786@hotmail.com
    Phone: 4164258695
    Postal Code': m3c1e6
    Interested:
    Comments: just testing thank you...

  • #8
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Post all of your HTML and PHP code. Also make sure they are placed in php or code tags.

  • #9
    New Coder
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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 = "mursallotest@gmail.com";
    $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.

  • #10
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.

  • #11
    New Coder
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts
    PHP Code:
    // EDIT THE 2 LINES BELOW AS REQUIRED 
    $email_to "mursallo@gmail.com"
    $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; 08-28-2011 at 09:30 PM.

  • #12
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Quote Originally Posted by mursallo View Post
    PHP Code:
    // EDIT THE 2 LINES BELOW AS REQUIRED 
    $email_to "mursallo@gmail.com"
    $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.

  • #13
    New Coder
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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);

  • #14
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.

  • #15
    New Coder
    Join Date
    Aug 2011
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Okay should I take off the variables of the code or should I put my email Address there?? ...thanks 'Reply-To: '.$mursallotest@gmail.com."\r\n"


    [ php ]
    <?php


    code on the middle right


    ?>
    [ / php ]
    Last edited by mursallo; 08-28-2011 at 11:09 PM.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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