Hello avryone.
I have a problem with my site, I need your help.
The problem is: constantly anoyne spam on my web site, constantly anyone
create ads on my webpage. My page is for create facebook like phrases.
I need your help to install Recaptcha. I followed these steps
http://code.google.com/apis/recaptcha/intro.html
But I encountered a problem
when you write something and click Send to create phrase, if you enter
wrong Recaptcha key says: "The reCAPTCHA wasn't entered correctly. Go
back and try it again" its ok, but when you insert corectrly key says: "Could
not open socket".
The code is follow:
this is my page url: http://lajkovi.x10.mx/
Can anoyne help me?
thank you
I have a problem with my site, I need your help.
The problem is: constantly anoyne spam on my web site, constantly anyone
create ads on my webpage. My page is for create facebook like phrases.
I need your help to install Recaptcha. I followed these steps
http://code.google.com/apis/recaptcha/intro.html
But I encountered a problem
when you write something and click Send to create phrase, if you enter
wrong Recaptcha key says: "The reCAPTCHA wasn't entered correctly. Go
back and try it again" its ok, but when you insert corectrly key says: "Could
not open socket".
The code is follow:
PHP:
//beginning of index.php
<?
include ("config.php");
if ($_POST["fb"]) {
$fb=$_POST["fb"];
mysql_query("INSERT INTO fblike VALUES(NULL, '$fb', '1')");
$x=mysql_query("SELECT * FROM fblike ORDER BY id DESC
LIMIT 1");
while ($y=mysql_fetch_assoc($x)){
$id=$y['id'];
}
require_once('recaptchalib.php');
$privatekey = "private key here ";
$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 verification
}
?>
<script type="text/javascript"> window.location.href="<?=$url_site?
>like.php?id=<?=$id?>";</script>
<?
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
..
...
....
<body>
<div class="form">
<?php
require_once('recaptchalib.php');
$publickey = "Public key"; // you got this from the signup page
?>
<form method="POST" action="index.php">
<div><textarea cols="" rows="" class="input-textarea
autoclear" name="fb" id="message">Your message</textarea></div>
<div><input type="submit" value="Send"
class="button button-blue float-right" /></form>
<?php
echo recaptcha_get_html($publickey);
?>
</div>
Can anoyne help me?
thank you
Last edited: