Multiple Captcha fields in one page
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {
extract($_POST) ; // extract our var names
//your site secret key
$secret = '6Le8wh8UAAAAABIWg-e4i6HjHof-EJNm9Pw_MeRK';
//get verify response data
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
$responseData = json_decode($verifyResponse);
if($responseData->success) {
//set POST variables
$url = 'https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
$fields = array(
'oid'=>urlencode($oid),
'Lead_ID__c'=>urlencode($Lead_ID__c),
'retURL'=>urlencode($retURL),
'Referred_By__c' => urlencode($Referred_By__c),
'last_name'=>urlencode($last_name),
'company'=>urlencode($company),
'email'=>urlencode($email),
'phone'=>urlencode($phone)
);
//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');
//print_r($fields_string);
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
$succMsg = 'Your contact request have submitted successfully.';
// echo $succMsg ;
// exit;
}
// response Failed
else {
$errMsg = 'Robot verification failed, please try again.';
// echo $errMsg ;
//exit;
}
}
else {
$errMsg = 'Please click on the reCAPTCHA box.';
// echo $errMsg ;
//exit;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Free Mobile Card Reader - SkyBank Financial</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script src="https://www.google.com/recaptcha/api.js?onload=CaptchaCallback&render=explicit" async defer></script>
</head>
<body>
<a id="top" href="#header">Back to top</a>
<div id="header">
<div id="header-wrap">
<h1 id="logo"><a href="index.html">SkyBank Financial</a></h1><!-- logo -->
<ul id="menu">
<li id="compare"><a href="#compare-section">Compare</a></li>
<li id="mobile"><a href="#mobile-section">Mobile</a></li>
<li id="started"><a href="#getstarted-section">Get Started</a></li>
</ul><!-- menu -->
<p id="telephone">Speak to a SkyBank Consultant 1-800-718-0446</p><!-- telephone -->
<div class="clear"></div><!-- clear -->
</div><!-- header-wrap -->
</div><!-- header -->
<div id="banner">
<div id="banner-wrap">
<?php if(!empty($errMsg)): ?><div class="errMsg"><?php echo $errMsg; ?></div><?php endif; ?>
<?php if(!empty($succMsg)): ?><div class="succMsg"><?php echo $succMsg; ?></div><?php endif; ?>
<!-- Contact Form -->
<form action="" method="POST" id="leadform">
<input type=hidden name="oid" value="00DA0000000HLYJ">
<input type=hidden name="retURL" value="http://www.freemobilecardreader.com/thankyou.html">
<input type=hidden name="Referred_By__c" value="SEO - BetterThanSquare">
<input type=hidden name="Lead_ID__c" value="Home Page">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: These fields are optional debugging elements. Please uncomment -->
<!-- these lines if you wish to test in debug mode. -->
<!-- <input type="hidden" name="debug" value=1> -->
<!-- <input type="hidden" name="debugEmail" -->
<!-- value="taronica@skybankfinancial.com"> -->
<!-- ---------------------------------------------------------------------- -->
<p><label for="last_name" class="form_label">Contact Name</label><br/>
<input id="last_name" maxlength="80" name="last_name" class="form_input" type="text" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/></p>
<p><label for="company" class="form_label">Company Name</label><br/>
<input id="company" maxlength="40" name="company" class="form_input" type="text" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/></p>
<p><label for="email" class="form_label">Email Address</label><br/>
<input id="email" maxlength="80" name="email" class="form_input" type="text" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/></p>
<p><label for="phone" class="form_label">Phone Number</label><br/>
<input id="phone" maxlength="40" name="phone" class="form_input" type="text" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/></p>
<input type="hidden" id="fax_number" value="">
<div class="g-recaptcha" data-sitekey="6Le8wh8UAAAAAJ6_kahoP82IbvVROpjf0iN6Kraw"></div>
<div id="result"></div>
<input type="submit" name="submit" id="submit" class="submit">
</form>
<!-- 3. End Contact Form -->
<a id="banner-compare" href="#compare-section">See how we compare</a>
<div class="clear"></div><!-- clear -->
</div><!-- banner-wrap -->
</div><!-- banner -->
<div id="content">
<div id="compare-section">
<h1>COMPARE US TO THE COMPETITION.</h1>
<!-- chart begins -->
<div id="chart-left">
<ul>
<li id="price">Straight forward pricing 2.70% per swipe*</li>
<li id="mobile">FREE Mobile Apps</li>
<li id="gateway">FREE State of the Art Gateway</li>
<li id="support">24/7/365 In-House Customer Support</li>
<li id="volumes">No Limits on Processing Volumes</li>
<li>Lifetime Lowest Rate Guarantee</li>
<li id="terminals">Seamless Integration with Most POS Equipment & Terminals</li>
<li id="chargeback">Dedicated Chargeback Resolution Department</li>
</ul>
</div><!-- chart-left -->
<div id="chart-center">
<ul>
<li id="title">SkyBank</li>
<li class="light"><img src="/images/check-gold.png"></li>
<li class="dark"><img src="/images/check-gold.png"></li>
<li class="light"><img src="/images/check-gold.png"></li>
<li class="dark"><img src="/images/check-gold.png"></li>
<li class="light"><img src="/images/check-gold.png"></li>
<li class="dark"><img src="/images/check-gold.png"></li>
<li class="light"><img src="/images/check-gold.png"></li>
<li class="dark"><img src="/images/check-gold.png"></li>
</ul>
</div><!-- chart-center -->
<div id="chart-right">
<li id="title">Competition</li>
<li><img src="images/check-black.png"></li>
<li><img src="images/check-black.png"></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</div><!-- chart-right -->
<div class="clear"></div><!-- clear -->
<div id="chart-bottom">
<ul>
<li>2.70% per swipe</li>
<li>No Additional Transaction Fees</li>
<li>Next Day Funding</li>
<li>FREE Mobile Card Reader</li>
</ul>
<div class="clear"></div><!-- clear -->
</div><!-- chart-bottom -->
<!-- chart ends -->
<a class="get-started" href="#getstarted-section">Get Started</a>
<a class="link-arrow" href="#mobile-section">We're also compatible with your device.</a>
<div class="line"></div><!-- line -->
</div><!-- compare -->
<div id="mobile-section">
<h1>FREE Card Reader for Your Android, iPhone, iPad, <br/>or Windows PC.</h1>
<div id="iphone">
<div class="slideshow">
<img src="images/slide1.jpg" />
<img src="images/slide2.jpg" />
<img src="images/slide3.jpg" />
<a href="http://www.skybankfinancial.com/apply-now.php" target="_blank"><img src="images/slide4.jpg" /></a>
</div><!-- slideshow -->
<div class="nav">
<a id="prev" href="#">Prev</a>
<a id="next" href="#">Next</a>
</div><!-- .nav -->
<div id="nav"></div><!-- #nav -->
</div><!-- iphone -->
<a class="get-started" href="#getstarted-section">Get Started</a>
<a class="link-arrow" href="#getstarted-section">Get in contact with a SkyBank Consultant.</a>
<div class="line"></div><!-- line -->
</div><!-- mobile -->
<div id="getstarted-section">
<h1>Start Accepting Credit Cards, Today!</h1>
<!-- Contact Form -->
<form action="" method="POST" id="leadform2">
<input type=hidden name="oid" value="00DA0000000HLYJ">
<input type=hidden name="retURL" value="http://www.freemobilecardreader.com/thankyou.html">
<input type=hidden name="Referred_By__c" value="SEO - BetterThanSquare">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: These fields are optional debugging elements. Please uncomment -->
<!-- these lines if you wish to test in debug mode. -->
<!-- <input type="hidden" name="debug" value=1> -->
<!-- <input type="hidden" name="debugEmail" -->
<!-- value="taronica@skybankfinancial.com"> -->
<!-- ---------------------------------------------------------------------- -->
<p><label for="last_name" class="form_label">Contact Name</label><br/>
<input id="last_name" maxlength="80" name="last_name" class="form_input" type="text" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/></p>
<p><label for="company" class="form_label">Company Name</label><br/>
<input id="company" maxlength="40" name="company" class="form_input" type="text" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/></p>
<p><label for="email" class="form_label">Email Address</label><br/>
<input id="email" maxlength="80" name="email" class="form_input" type="text" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/></p>
<p><label for="phone" class="form_label">Phone Number</label><br/>
<input id="phone" maxlength="40" name="phone" class="form_input" type="text" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/></p>
<input type="hidden" id="fax_number" value="">
<div id="captcha2" class="g-recaptcha" data-sitekey="6Le8wh8UAAAAAJ6_kahoP82IbvVROpjf0iN6Kraw"></div>
<div id="result"></div>
<input type="submit" name="submit" id="submit" class="submit">
</form>
<div id="result"></div>
<!-- 3. End Contact Form -->
<div class="clear"></div><!-- clear -->
<div class="line"></div><!-- line -->
</div><!-- getstarted-section -->
<img id="footer" src="images/footer.jpg">
</div><!-- content -->
<p id="disclaimer">SkyBank Financial is a registered ISO/MSP of Wells Fargo Bank, N.A., Walnut Creek, C.A. American Express and Discover may require separate authorization. Approval of merchant account required and is based upon the Processing Bank's underwriting requirements. In no way does this constitute a warranty of final pricing which is subject to final approval by our underwriters. Your merchant account is subject to the terms and conditions of the Merchant Services Program Guide. *With SkyBank's per-swipe pricing, swiped transactions for Visa, MasterCard, and Discover have the same flat rate of 2.70%. American Express transactions are billed at the pricing designated by American Express based on your SIC code. SkyBank accounts come with a lifetime lowest rate and have a $35 monthly minimum. If you type in the card information manually, our fee is 3.15% + 15¢. All SkyBank merchants are required to validate PCI Compliance within 90 days of account approval. Traditional non-transactional merchant processing fees may apply. Talk to your account representative for details.</p>
</body>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script>
function onSubmit() {
console.log("SUBMITTED") ;
document.getElementById("leadform").submit();
}
function onSubmit2() {
console.log("SUBMITTED") ;
document.getElementById("leadform2").submit();
}
var CaptchaCallback = function() {
$('.g-recaptcha').each(function(index, el) {
grecaptcha.render(el, {'sitekey' : '6Le8wh8UAAAAAJ6_kahoP82IbvVROpjf0iN6Kraw'});
});
};
</script>
</html>