0

I was trying to include reCaptcha on my web form, so i started following the instructions from this site

https://webdesign.tutsplus.com/tutorials/how-to-integrate-no-captcha-recaptcha-in-your-website--cms-23024

it said to download recaptchalib.php from the google site then place that file on my server. Then i had a php script like this to process the form when submit was pressed:

<?php 
require_once ('recaptchalib.php');
foreach ($_POST as $key => $value) {
    echo '<p><strong>' . $key.':</strong> '.$value.'</p>';
}
?>

It just echos the form variables.

When i press submit from my web form, i was shocked to see that it dumped out the contents of this website

https://github.com/google/recaptcha/blob/1.0.0/php/recaptchalib.php

and then dumped the form variables underneath.

So basically the require_once line in the php script is causing it to dump the entire contents of https://github.com/google/recaptcha/blob/1.0.0/php/recaptchalib.php

How that can ever happen? is recaptchalib.php dumping the website?

I cant get it to stop doing that, does anybody have an explanation?

Its the most bizarre thing i ever seen!!!

Thanks

Paul Patt
  • 3
  • 5
  • did you try to use include? are there any errors mentioned? – Miggy Jan 05 '18 at 03:36
  • I tried include it does the same thing, and no errors given. If i remove include and require_once it doesnt do it. – Paul Patt Jan 05 '18 at 03:40
  • I don't know how but is it something to do with your headers? – Beans Jan 05 '18 at 03:44
  • i didnt mess with any headers – Paul Patt Jan 05 '18 at 03:46
  • How did you download the file? Have you checked it’s contents and compared it against what you’re supposed to have? – Major Productions Jan 05 '18 at 03:48
  • I just clicked on it and it downloaded, no i didnt check it – Paul Patt Jan 05 '18 at 03:50
  • 1
    i just checked the file, turns out the file has HTML code in there, so that was the problem – Paul Patt Jan 05 '18 at 03:51
  • Is the code included the actual code you're running? Are you missing the php after the ? Can you include more information about file names you're running and the sequencing of what file shows first, then how you get to the code above? – Jesse Q Jan 05 '18 at 03:51
  • Jesse, the problem was that i downloaded a php file from https://github.com/google/recaptcha/blob/1.0.0/php/recaptchalib.php i thought it was a p hp file, but actually its an html file that contains the entire website. I dont know why they would create a file with .php at the end but it actually contains html code. – Paul Patt Jan 05 '18 at 04:21

0 Answers0