i want to display captcha image but its not working

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 6
Joined: Thu Jun 21, 2012 3:18 am

Tue Jul 03, 2012 11:41 pm

$name =$_POST['name'];
$eamil =$_POST['email'];
$code = $_POST['6_letters_code'];
$sql = "INSERT INTO `form` VALUES ('$name','$eamil','code')";

if(empty($_SESSION['6_letters_code'] ) ||
strcasecmp($_SESSION['6_letters_code'], $_POST['6_letters_code']) != 0)
//Note: the captcha code is compared case insensitively.
//if you want case sensitive match, update the check above to
// strcmp()
$errors .= "\n The captcha code does not match!";
//send the email
$to = $your_email;
$subject="New form submission";
$from = $your_email;
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
$body = "A user $name submitted the contact form:\n".
"Name: $name\n".
"Email: $visitor_email \n".
"Message: \n ".
"IP: $ip\n";
$headers = "From: $from \r\n";
$headers .= "Reply-To: $visitor_email \r\n";
mail($to, $subject, $body,$headers);



<!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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<form id="form1" name="form1" method="post" action="">
<table width="500" align="center">
<td width="201">Name</td>
<td width="287"><input type="text" name="name" id="name" /></td>
<td><input type="text" name="email" id="email" /></td>
<img src="captcha.php"/>
<td><input type="text" name="6_letters_code" id="6_letters_code" /></td>
<td><input type="submit" name="submit" id="submit" value="Submit" /></td>
:help: :help: :help: :help: :help: :help:

Post Reply