I am editing a Wordpress themes contact form. I am adding a select dropdown menu, based on which option is selected, the email will be sent to a different address. My WP options works fine, I tested it. The problem is the select box. For some reason the select value comes back blank in the email, since its coming back blank, I cant make the rest of my logic function properly.
<div class="column1">
<select class="selectclass" name="question" id="question">
<option value ="9" selected>What is your question?</option>
<option value ="1">I would like to see a demo</option>
<option value ="2">I’d like to learn more about native advertising</option>
<option value ="3">I am a publisher and interested in seeing products</option>
<option value ="4">I am an advertiser and I want to speak to a sales representative</option>
<option value ="5">I am interested in partnering with Content That Works</option>
<option value ="6">I have an issue with my billing</option>
<option value ="7">There is something technically wrong with your website</option>
<option value ="8">Other questions</option>
</select>
</div>
<?php
require_once('recaptchalib.php');
require('../../../../wp-blog-header.php');
global $qode_options_proya;
$publickey = $qode_options_proya['recaptcha_public_key'];
$privatekey = $qode_options_proya['recaptcha_private_key'];
if ($publickey == "") $publickey = "6Ld5VOASAAAAABUGCt9ZaNuw3IF-BjUFLujP6C8L";
if ($privatekey == "") $privatekey = "6Ld5VOASAAAAAKQdKVcxZ321VM6lkhBsoT6lXe9Z";
$resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
$quest = $_POST["question"];
$use_captcha = $qode_options_proya['use_recaptcha'];
if ($resp->is_valid || $use_captcha == "no") {
?>success<?php
$email_to = $qode_options_proya['native_mail'];
$email_from = $qode_options_proya['email_from'];
$subject = $qode_options_proya['email_subject'];
$text = "Name: " . $_POST["name"] . " " . $_POST["lastname"] . "\n";
$text = "Question: " . $_POST["question"] . "\n";
$text .= "Email: " . $_POST["email"] . "\n";
$text .= "WebSite: " . $_POST["website"] . "\n";
$text .= "Message: " . $_POST["message"];
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/plain; charset=utf-8" . "\r\n";
$headers .= "From: '".$_POST['name']." ".$_POST['lastname']."' <".$email_from."> " . "\r\n";
$result = wp_mail($email_to, $subject, $text, $headers);
if(!$result) {
global $phpmailer;
var_dump($phpmailer->ErrorInfo);
}
}
else {
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")");
}
?>
Any help would be greatly appreciated, thank you.
UPDATE Here are the full pages.... http://pastebin.com/vyT6J4PH http://pastebin.com/kk2Byy6S