1 Replies - 203 Views - Last Post: 16 October 2017 - 05:34 PM

#1 Maxx5  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 203
  • Joined: 15-September 15

Google Recaptcha

Posted 15 October 2017 - 01:17 PM

I have been having a lot of problems setting up Google Recaptha on a page. I was getting errors on the form page and figured out that. but now after clicking the submit button. it goes to a blank page called test.php. her is my link and code.

http://www.empowered...lassifieds.html

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Home - Empowered Golfers Mb.</title>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css">
    <link rel="stylesheet" href="http://empoweredgolfersmanitoba.ca/css/custom.css">
    <link rel="stylesheet" href="http://empoweredgolfersmanitoba.ca/ChatRoom/style.css">
    <link rel="stylesheet" type="text/css" href="chatSocketAchex.css"></head>

<body>
<script>

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-89888824-1', 'auto');

  ga('send', 'pageview');

</script>
    <div class="container">
        <div class="row" id="header">
            <div class="col-sm-12">
                <nav class="navbar navbar-inverse navbar-custom">
                    <div class="navbar-header">
                      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                      </button>
                        <a class="navbar-brand hidden-xs"  style="color: #000000; font-size: 2.25em;">Empowered Golfers Manitoba</a> 
                        <a class="navbar-brand visible-xs" style="color: #000000; font-size: 1.50em;">Empowered Golfers Manitoba</a>
                    </div>
                    <ul class="nav navbar-nav navbar-left collapse navbar-collapse" id="myNavbar">
                        <li><a href="index.html">Home</a></li>
                      
                       
                    <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">Links<span class="caret"></span></a>
                    <ul class="dropdown-menu">
                    <li><a href="buyandsell.html">Buy & Sell</a></li>
                    <li><a href="http://caga.ca/wp/" target="_blank">Canadian Amputee Golf Association (CAGA)</a></li>
                    <li><a href="Products.html">Pruducts</a></li>
                    <li><a href="Groups.html">Groups</a></li>
                    <li><a href="comingsoon.html">Golf Buddy</a></li>
                    <li><a href="GolfCourseOwners.html">Golf Course Owners and Operators</a></li>
             </ul>
           </li>
                       
                   <li><a href="Provinces.html">Provinces</a></li>                  
                   <li><a href="Courses.html">Courses</a></li>
                   <li><a href="Snowbirds.html">Snowbirds</a></li>         
                   <li><a href="http://www.empoweredgolfersmanitoba.ca/phpBB3/">Discussion Board</a></li>     
                   <li><a href="Chatroom.html">Live Chat</a></li> 
                   <li><a href="Contact.html">Contact</a></li>    
                  
                       
                    </ul>
                </nav>
            </div>
        </div>
    </div>

  <div class="container bg-color">
      <div class="row">
            <div  style="padding-top: 15px;">
                <div id="myCarousel" class="carousel slide" data-ride="carousel">
                    <!-- Indicators -->
                    <ol class="carousel-indicators">
                        <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                        <li data-target="#myCarousel" data-slide-to="1"></li>
                        <li data-target="#myCarousel" data-slide-to="2"></li>
                        <li data-target="#myCarousel" data-slide-to="3"></li>
                        <li data-target="#myCarousel" data-slide-to="4"></li>
                    </ol>

                    <!-- Wrapper for slides -->
                     <div class="carousel-inner" role="listbox">
                        <div class="item active">
 <img src="img/AdobeStock_83234383.jpg" alt="" width="1920" height="546">
</div>
<div class="item">
 <img src="img/AdobeStock_110313737.jpg" alt="" width="1920" height="546">
</div>
<div class="item">
 <img src="img/AdobeStock_72595945.jpg" alt="" width="1920" height="546">
</div>
<div class="item">
 <img src="img/image5675.jpg" alt="" width="1920" height="546">
</div>
<div class="item">
 <img src="img/image6633.jpg" alt="" width="1920" height="546">
</div>
                    </div>

                    <!-- Left and right controls -->
                    <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
                        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                        <span class="sr-only">Previous</span>
                    </a>
                    <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
                        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                        <span class="sr-only">Next</span></a>
              </div>  
        </div>
    </div>
</div>
       
        &nbsp;
        <div class="container bgWhite">
        <div id="title">
         <div class="left">Submission Form</div>
         <div class="right"><a href="https://www.facebook.com/groups/637729496399795/" target="_blank"><img src="img/Facebook.jpg" width="50" height="50" alt="Facebook"/></a>&nbsp;&nbsp;<a href="https://twitter.com/EmpoweredGolf" target="_blank"><img src="img/twitter.jpg" width="50" height="50" alt="Twitter"/></a></div>
        </div>
 </div>

    
&nbsp;
        <div class="container bgWhite">
         <form method="post" action="test.php">
         &nbsp; 
         
<h4><strong>First Name:</strong> <input name="first_name" type="text"></h4>
<h4><strong>Last Name:</strong> <input name="last_name" type="text"></h4>
<h4><strong>Email Address:</strong> <input name="email" type="text"></h4>
<h4><strong>Sale </strong>
  <input type="radio" name="choice" value="sale" checked>
  <br>
  <strong>Wanted </strong>
  <input type="radio" name="choice" value="wanted">
  <br>
</h4>
<p><label for="textarea"><strong>Advertisement</strong>:</label> 
<textarea name="advertisement"></textarea>
			 </p>
 <div class="g-recaptcha" data-sitekey="6Lc7mTMUAAAAAPwERX6akk1DQkmsqpUGGw7hpV-c"></div>

 &nbsp;
<p><input type="submit" name="submit" id="submit" value="Submit"> </p>
</form>&nbsp;

</div>



<div class="container">
  <div class="row">
    <div class="col-sm-12 whiteText">
      <p>&copy; 2017 Empowered Golfers Manitoba</p>
    </div>
  </div>
</div>
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Latest compiled Javascript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>


		<script src="chatSocketAchex.js"></script>
		<script type="text/javascript">
           $("#Chatroom").ChatSocket();
        </script>
		<script>
  $(function() {
var selector = '.nav li';
$(selector).on('click', function(){
    $(selector).removeClass('active');
    $(this).addClass('active');
});
     });
</script>
</body>
<script src="https://www.google.com/recaptcha/api.js"></script>

</html>




<?php
if (isset($_POST['ContactButton'])){
	
	$url = 'https://www.google.com/recaptcha/api/siteverify';
	$privatekey = "6Lc7mTMUAAAAAE8UzI93oq3XFYXWRoMBp3oAz2gr";
      
	$response = file_get_contents($url."?secret=".$privatekey."&response=".$_POST['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR']);
	$data = json_decode($response);
	
	if(isset($data->success) AND $data->success==true){
		
		            header('Location: Classifieds.html?CaptchaPass=True');
		
	}else{
		
		            header('Location: Classifieds.html?CaptchaFail=True');
		
		
	}
		
	
}
?>


Is This A Good Question/Topic? 0
  • +

Replies To: Google Recaptcha

#2 Maxx5  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 203
  • Joined: 15-September 15

Re: Google Recaptcha

Posted 16 October 2017 - 05:34 PM

I have my captcha working now. But I now came up with a problem. my Captcha is not accessible to screen readers. Does anyone have experience with this issue?Screen reader does not see the combination of letters and numbers.

http://www.empowered...lassifieds.html

This post has been edited by Maxx5: 16 October 2017 - 05:35 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1