help in image varification form. my question is how can i add image varification

  • Thread starter Thread starter hamayoun
  • Start date Start date
H

hamayoun

Guest
code in this contact.php? contact.php
<?php

if (isset($_POST['submit'])){

$to="".$_POST['friendemail']."";

$subject="".$_POST['yourname']." wants you to check this out!";

$mail_from="from: ".$_POST['youremail']." \n";

$mail_from .="Content-Type: text/html; charset=utf-8 \n";

$message="<font size=\"2\" face=\"Verdana\"> <b>".$_POST['friendemail']."</b>,<br />
".$_POST['yourname']." wants you to check this website!!:<br />

<a href=\"http://www.google.com\">google</a> </font>";

$sentmail = mail($to,$subject,$message,$mail_from);

echo "We told your friend!";


}else{

?>

<form action="" method="post">
Your Name:<br />
<input type="input" name="yourname" /><br />
Your Email:<br />
<input type="input" name="youremail" /><br />
Friend name:<br />
<input type="input" name="friendname" /><br />
Friend email:<br />
<input type="input" name="friendemail" /><br /><br />
<br>
Enter Code <img src="captcha.php"><input type="text" name="vercode" /><br>
<input type="submit" name="submit" value="Tell Your Friend" />
</form>

<?php } ?>
captcha.php
<?php
session_start();
$text = rand(10000,99999);
$_SESSION["vercode"] = $text;
$height = 25;
$width = 65;

$image_p = imagecreate($width, $height);
$black = imagecolorallocate($image_p, 0, 0, 0);
$white = imagecolorallocate($image_p, 255, 255, 255);
$font_size = 14;

imagestring($image_p, $font_size, 5, 5, $text, $white);
imagejpeg($image_p, null, 80);
?>
i get this image varification code from there
http://www.phpjabbers.com/captcha-image-verification-php19.html

but i fails to add this cod in my contact.php form
 
Back
Top