Hi
I am currently working in a project . My webpage has a form.
Now I want to implement the google recapture on this form.
please have a look
/payingsitesranks.hits2sites.com
I have created two php file
- new.php ( this file has the form)
- verify.php ( to verify the submited result)
Here is the files
new.php
[php]<?php
include(‘config.php’);
?>
<a href="".$url_root.“vote.php?id=”.$id."">Vote for this Website
Thank you";
$to = $_POST[‘email’];
$headers = “From: “Top site”<”.$mail_webmaster.">\n";
$headers .= “Reply-To: “.$mail_webmaster.”\n”;
$headers .= “Content-Type: text/plain; charset=“utf-8"”;
mail($to,$subject,$message,$headers);
}
//We protect the variables and we limit the number of letters of some fields
$name = mysql_escape_string(substr($_POST[‘name’],0,55));
$url = mysql_escape_string($_POST[‘url’]);
$description = mysql_escape_string(substr($_POST[‘description’],0,255));
$banner = mysql_escape_string($_POST[‘banner’]);
$email = mysql_escape_string($_POST[‘email’]);
//On ajoute le site a la bdd
if(mysql_query('insert into topsite (id, name, url, description, banner, email, votes, status) values (”’.$id.’", “’.$name.’”, “’.$url.’”, “’.$description.’”, “’.$banner.’”, “’.$email.’”, 0, “no”)’))
{
echo ‘Your website has successfully been submited, an admin will check it soon.
You can start earning votes:
<input type=“text” value="’.htmlentities(‘Vote for this Website’).’" size=“50” onclick=“this.select();” />’;
}
else
{
echo ‘An error occurred while submitting the website.’;
}
}
else
{
//We display the form
?>
To add your website to this top site, you have to fill the following form:
URL
Description
Banner
<?php } ?>
verify.php code
[php]<?php
include(‘config.php’);
?>
<a href="".$url_root.“vote.php?id=”.$id."">Vote for this Website
Thank you";
$to = $_POST[‘email’];
$headers = “From: “Top site”<”.$mail_webmaster.">\n";
$headers .= “Reply-To: “.$mail_webmaster.”\n”;
$headers .= “Content-Type: text/plain; charset=“utf-8"”;
mail($to,$subject,$message,$headers);
}
//We protect the variables and we limit the number of letters of some fields
$name = mysql_escape_string(substr($_POST[‘name’],0,55));
$url = mysql_escape_string($_POST[‘url’]);
$description = mysql_escape_string(substr($_POST[‘description’],0,255));
$banner = mysql_escape_string($_POST[‘banner’]);
$email = mysql_escape_string($_POST[‘email’]);
//On ajoute le site a la bdd
if(mysql_query('insert into topsite (id, name, url, description, banner, email, votes, status) values (”’.$id.’", “’.$name.’”, “’.$url.’”, “’.$description.’”, “’.$banner.’”, “’.$email.’”, 0, “no”)’))
{
echo ‘Your website has successfully been submited, an admin will check it soon.
You can start earning votes:
<input type=“text” value="’.htmlentities(‘Vote for this Website’).’" size=“50” onclick=“this.select();” />’;
}
else
{
echo ‘An error occurred while submitting the website.’;
}
}
else
{
//We display the form
?>
To add your website to this top site, you have to fill the following form:
URL
Description
Banner
<?php } ?>
I have already got the private key and site key from recaptcha site
Please implement the recaptcha verification on verify.php file