Link Protector - ReCaptcha

All support enquiries for other DaddyScripts' scripts go in here...

Link Protector - ReCaptcha

Postby gr0g » Sun Apr 21, 2013 7:29 pm

Would it be possible to add recaptcha to the link protector script instead of the current captcha? The main reason for this is that recaptcha has audio capability which is great for the visually impaired. This is by far the best link protector script ive found however without this im not sure if i can use it for my website. Im currently looking into adding this myself but this isnt going anywhere, as im no expert on php, if you can help in anyway that would be really great :)
gr0g
Standard Member
 
Posts: 5
Joined: Sun Apr 21, 2013 7:16 pm

Re: Link Protector - ReCaptcha

Postby SamEA » Mon Apr 22, 2013 2:29 am

Hello,

I advise you look at reCaptcha documentation on how to implement it and remove/replacing it with the current captcha in ./index.php by looking at the captcha used in DLP: http://www.white-hat-web-design.co.uk/b ... ty-images/.
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

Re: Link Protector - ReCaptcha

Postby gr0g » Mon Apr 22, 2013 6:17 pm

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?
gr0g
Standard Member
 
Posts: 5
Joined: Sun Apr 21, 2013 7:16 pm

Re: Link Protector - ReCaptcha

Postby SamEA » Mon Apr 22, 2013 11:03 pm

Can you please provide the link to where DLP is located in order for further investigation.
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

Re: Link Protector - ReCaptcha

Postby gr0g » Tue Apr 23, 2013 9:12 am

The testing url is as follows:

Code: Select all
http://linkz.uni.me


This domain has just been setup so it might take some time to propagate if its not resolving for you. Ive been testing this script on my local pc.
gr0g
Standard Member
 
Posts: 5
Joined: Sun Apr 21, 2013 7:16 pm

Re: Link Protector - ReCaptcha

Postby SamEA » Thu May 02, 2013 3:52 pm

Thank you for verifying your URL.

Try replacing:
Code: Select all
<form method="post" action="links.php">


or

Code: Select all
<form method="post" action="<?php echo $_SERVER['php_SELF'];?>">


with

Code: Select all
<form method="post" action="links.php?ID=<?php echo $_GET['ID'];?>">


The reason why you are receiving the above error, is most probably due to the GET ID parameter not being passed after the CAPTCHA form is submitted (POSTed).
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

Re: Link Protector - ReCaptcha

Postby gr0g » Tue May 07, 2013 3:16 pm

Ive used the following code as advised and it now works perfectly:

Code: Select all
<form method="post" action="links.php?ID=<?php echo $_GET['ID'];?>">


Thanks for your help with this! :)
gr0g
Standard Member
 
Posts: 5
Joined: Sun Apr 21, 2013 7:16 pm

Re: Link Protector - ReCaptcha

Postby gr0g » Tue May 07, 2013 4:23 pm

I have just been testing this now and it is working perfectly however the only thing missing is the links which are displayed after a successful captcha are no longer clickable. The code from the following thread makes links clickable, this part must have been left out of the links.php page as its not working.
Code: Select all
http://forum.daddyscripts.com/viewtopic.php?f=34&t=317p


Can you advise? The contents of the links.php page is contained in my post above. (Apologies for double post, i dont seem to be able to edit my previous one)
gr0g
Standard Member
 
Posts: 5
Joined: Sun Apr 21, 2013 7:16 pm


Return to Other DS Scripts!

Who is online

Users browsing this forum: No registered users and 2 guests

cron