Hi,
Thanks for the link, i was able to add the captcha on the index page, this is working fine now however when the captcha is entered correctly it loads up a new page (links.php) which gives the following error:
Warning: file_get_contents(./files/.dlp): failed to open stream: No such file or directory in /var/www/localhost/links.php on line 27
After the captcha is verified the links should be displayed but this isnt working, below is a copy of the code from links.php which a successfully submitted captcha links to:
- Code: Select all
<?php
include('header.php');
require_once('recaptchalib.php');
$privatekey = "xxxxxxxxx";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
//Your code here to handle a successful captcha.
$fileconfig = fopen("./config/".$_GET['ID'].".dlp","w");
fwrite($fileconfig, $content[0]. "|" .$content[1] ."|" .$content[2] ."|" .$content[3] ."|" .($content[4] + 1));
fclose($fileconfig);
$_SESSION['views'] = $_GET['ID'];
$views = $content[4] + 1;
}
?>
</FORM><p align="center">Hidden Links:<BR>
<?php $fetch = file_get_contents("./files/".$_GET["ID"].".dlp"); echo $fetch; ?><BR><BR>
</p>
<?php
include('./footer.php');
?>
Can you provide any advice?