Form submit not sumbitting
-
Hello,
I have had the following form for years, and it has always worked, until about a year ago when Google took over Captcha, or whatever happened in that arena.
https://www.lh-productions.com/av/?page_id=10
I’ve managed to update my Captcha keys, but the emails still disappear into cyberspace, i.e. I never receive any of them. The form submit page came with my AV 1.0 Theme. This is currently what’s displayed on the Contact Page Template. There is also a ajaz.recaptcha.php, as well as a recaptchalib.php
I am not a designer, just had to take over after the guy I hired to do WordPress dropped off the face of the planet. Any direction is appreciated.
Thanks!
————————————
<?php /* Template Name: contact */ require_once "recaptchalib.php"; $publickey = "MY KEY IS HERE"; // you got this from the signup page $privatekey = "MY OTHER KEY IS HERE"; if ($_POST['btnQuoteRequest']) { echo $_POST['txtName'] . ""; $name = $_POST['txtName']; $companyName = $_POST['txtComName']; $email = $_POST['txtemail']; $phone = $_POST['txtPH']; $contnet = $_POST['txstDescription']; $to = "MY EMAIL IS HERE"; $subject = "Contactus: " . $_POST["txtName"]; $message = $contnet; $from = $_POST["txtemail"]; $phone = "phone :" . $_POST["txtPH"] . "\r\n"; $headers = "From: $from"; $msg = $phone . $message; if (mail($to, $subject, $msg, $headers)) { echo "Email Sent"; } else { echo "Email not Sent"; } } get_header(); ?> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.validate.js"></script> <div class='contactBox'> <div class='contactBoxtop'><div class="innerRight"><div class="innertTop"></div></div></div> <div class='contactBoxcontent'> <h1>Quote Request</h1> <p style="color:#000;">This form and any attached document are transmitted securely and treated confidentially</p> <form action="<?php echo $PHP_SELF;?>" method="post" enctype="multipart/form-data" id="frmContactus" onsubmit="return validateCaptcha();"> <div class="label"><label>Your Name: <span>*</span></label></div> <div class="input"><input type="text" class="required" name="txtName"></div> <div class="label">Company/Organization <span>*</span></div> <div class="input"><input type="text" class="required" name="txtComName"></div> <div class="label"><label>Your Email: <span>*</span></label></div> <div class="input"><input type="text" class="required email" name="txtemail"></div> <div class="label"><label>Phone number: (Numerals only, no dashes, spaces or characters)</label></div> <div class="input"><input type="text" class="txtPH number" name="txtPH"></div> <div class="label"><label>Description <span>*</span></label></div> <div class="input"><textarea id="txstDescription" class="required" name="txstDescription" cols="55" rows="8"></textarea></div> <div id="input"> <div id="fileInput" style="margin-bottom:10px;"> <div class="input" style="margin-bottom:0px;"><input type="file" class="txtfile" name="txtfile"></div> <div class="label"><label>Optionally attach a document (up to 10MB)</label></div> </div> </div> <div id="captchareg"> <p><?php echo recaptcha_get_html($publickey);?></p> <p style="color: red;" id="captchaStatus">?</p> </div> <div id="btnControl"><input type="reset" name="btnReset" id="btnReset" value=""> <input type="submit" name="btnQuoteRequest" id="btnQuoteRequest" value=""></div> </form> </div> <div class='contactBoxbottom'><div class="innerRight"><div class="innertBottom"></div></div></div> </div> <div class='contactRBox'> <div class='contactRBoxtop'><div class="innerRight"><div class="innertTop"></div></div></div> <?php echo $post->post_content; ?> <div class='contactRBoxbottom'><div class="innerRight"><div class="innertBottom"></div></div></div> </div> <script type="text/javascript"> jQuery("#frmContactus").validate({ }); </script> <script type="text/javascript"> function validateCaptcha() { challengeField = $("input#recaptcha_challenge_field").val(); responseField = $("input#recaptcha_response_field").val(); //alert(challengeField); //alert(responseField); //return false; var html = $.ajax({ type: "POST", url: "<?php echo bloginfo('template_directory');?>/ajax.recaptcha.php", data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField, async: false }).responseText; if(html == "success") { $("#captchaStatus").html("Success. Submitting form."); return true; // Uncomment the following line in your application //return true; } else { $("#captchaStatus").html("Your captcha is incorrect. Please try again"); Recaptcha.reload(); return false; } } </script> <style type="text/css"> .recaptchatable #recaptcha_response_field{ bottom: 2px!important; height: 25px; } .contactBoxcontent p{ margin: 5px 0 5px 0; } </style> <?php get_footer(); ?>
[Please, please use the code buttons when posting code here – your code may have been damaged by the forums parser]
- The topic ‘Form submit not sumbitting’ is closed to new replies.