Warning
Posted: Wed Feb 15, 2012 6:21 am
hi trying to work on captcha images...m getting the following error could some1 please correct the script.....?
Warning: require_once(captcha/recaptchalib.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\udupipages\captcha\contact-us.php on line 69
this s my code
<?php
require_once('captcha/recaptchalib.php');
$privatekey = "your_private_key";
$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
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$con = mysql_connect( "localhost", "login", "login123" );
if(!$con)
{
die('Could not connect:' . mysql_error());
}
mysql_select_db("test",$con);
$applieddate = date('d-m-y');
$sql = "INSERT INTO contact( Name, Email,Phone,Company,City,State,Country,Zip,Comments,Date)
VALUES ('$_POST[Name]', '$_POST[Email]', '$_POST[Phone]', '$_POST[Company]', '$_POST[City]', '$_POST[State]','$_POST[Country]', '$_POST[Zip]', '$_POST[Comments]','$applieddate' )" or die(mysql_error());
if(!mysql_query($sql,$con))
{
die('Error:' . mysql_error());
}
echo "<strong>Thanx for contacting us</strong>" . "<br />";
mysql_close();
?>
</body>
</html>
Warning: require_once(captcha/recaptchalib.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\udupipages\captcha\contact-us.php on line 69
this s my code
<?php
require_once('captcha/recaptchalib.php');
$privatekey = "your_private_key";
$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
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$con = mysql_connect( "localhost", "login", "login123" );
if(!$con)
{
die('Could not connect:' . mysql_error());
}
mysql_select_db("test",$con);
$applieddate = date('d-m-y');
$sql = "INSERT INTO contact( Name, Email,Phone,Company,City,State,Country,Zip,Comments,Date)
VALUES ('$_POST[Name]', '$_POST[Email]', '$_POST[Phone]', '$_POST[Company]', '$_POST[City]', '$_POST[State]','$_POST[Country]', '$_POST[Zip]', '$_POST[Comments]','$applieddate' )" or die(mysql_error());
if(!mysql_query($sql,$con))
{
die('Error:' . mysql_error());
}
echo "<strong>Thanx for contacting us</strong>" . "<br />";
mysql_close();
?>
</body>
</html>