...

View Full Version : I not getting my drop down menu in php



mursallo
08-25-2011, 10:25 PM
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:


<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
// 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..

sunfighter
08-26-2011, 04:55 PM
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

mursallo
08-26-2011, 10:43 PM
I didn't understand you well what you mean by Select Action ???

sunfighter
08-27-2011, 04:39 PM
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.

mursallo
08-27-2011, 07:13 PM
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 ????

Fou-Lu
08-27-2011, 09:50 PM
These two blocks have different names for your select. Which is it, Interested or Interestedin? The PHP code suggests it should be named Interested.

mursallo
08-27-2011, 10:35 PM
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...

Fou-Lu
08-28-2011, 05:17 AM
Post all of your HTML and PHP code. Also make sure they are placed in php or code tags.

mursallo
08-28-2011, 08:54 PM
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.

Fou-Lu
08-28-2011, 09:03 PM
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
or
tags.

mursallo
08-28-2011, 09:27 PM
// 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" . I HAVE TO CHANGE THIS TO MY EMAIL ???
'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 ??...

Fou-Lu
08-28-2011, 09:33 PM
// 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" . I HAVE TO CHANGE THIS TO MY EMAIL ???
'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.

mursallo
08-28-2011, 09:41 PM
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);

Fou-Lu
08-28-2011, 10:44 PM
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.

mursallo
08-28-2011, 11:01 PM
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 ]

mursallo
08-28-2011, 11:15 PM
You know what I remove it 'Reply-To: ' variables from the code still the same not getting the Interseted menu in my email ...

Fou-Lu
08-29-2011, 01:45 AM
You know what I remove it 'Reply-To: ' variables from the code still the same not getting the Interseted menu in my email ...

The reply-to will have no impact on the intersected variable. $email_from just doesn't exist, so you're reply-to would be null. That will not affect any other variable.
If you're still not getting the variable, your causes are:
1. Your browser is not sending them.
2. Your processing script isn't actually the script you are modifying.

Placing a simple printf('<pre>%s</pre>', print_r($_POST, true)); will let you establish if the Interested variable is set, and what its value is.

Like I said, I test this out and had no problem getting it to populate.

mursallo
08-31-2011, 09:20 PM
okay thanks for help its working now...thank you so much



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum