php - Google Captcha not displaying in GoDaddy secure (https) -


i'm having issue google's recaptcha not appear in https website , wondering if else here has encountered/is encountering same issue , has found way around it.

in test environment (localhost), appears fine , able send , receive forms. however, upon uploading godaddy hosted secure website, recaptcha image/div not appear , haven't slightest idea why.

please help.

below parts of code (that worked in localhost):

inside "head" tags

<script src='https://www.google.com/recaptcha/api.js'></script> 

inside "body" recaptcha appears:

<div class="contact_text">    <div class="g-recaptcha" id="googlecaptcha"                data-sitekey="sitekeyplaceholder"></div>    <?php echo "<p class='text-danger col-xs-offset-6 col-xs-6'>$errcaptcha</p>";?> </div> 

then "php" part:

$captcha = $_post['g-recaptcha-response']; $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=secretkeyplaceholder&response=".$captcha."&remoteip=".$_server['remote_addr']); if($response.success==false){     $errcaptcha = 'please check captcha form'; } 

i based off of tutorial https://codeforgeek.com/2014/12/google-recaptcha-tutorial/

to reiterate, code/page/form works in localhost test environment doesn't show when uploaded godaddy-hosted https website.

i appreciate or suggestions. thank you.

update:

since nor has leads on topic, opted go different captcha called "secureimage" adequately fulfilled needs for now. keep question open want use google's captcha because of intuitive impressive checkbox style captcha.

hopefully, in near future finds way.

solution:

removing "https:" source path shows google recaptcha!

<script src='//www.google.com/recaptcha/api.js'></script> 

code block , form works. matthew3k!

remove "https:" source path.

<script src='//www.google.com/recaptcha/api.js'></script> 

i have found method successful loading cross-domain resources on secure sites.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -