B
Brandon
Guest
Image Verification
I'm sure all of you have gone to an email and when your logging in you get a message saying to verify the words in the box.
This is for security so people can not make "bots" automatily sign-up for a service or send massive amounts of emails.
You need PHP and the GD Library. (X10 has this installed)
Create a php file and name it verification.php inside post this code.
<FONT style="BACKGROUND-COLOR: #ffffff">
Then create another file this time named form.php inside post this code.
<FONT style="BACKGROUND-COLOR: #ffffff">
I'm sure all of you have gone to an email and when your logging in you get a message saying to verify the words in the box.
This is for security so people can not make "bots" automatily sign-up for a service or send massive amounts of emails.
You need PHP and the GD Library. (X10 has this installed)
Create a php file and name it verification.php inside post this code.
<FONT style="BACKGROUND-COLOR: #ffffff">
PHP:
<?php
session_start();
$random = trim($random);
if ($new_string == $random){
ON THIS LINE YOU MAY PLACE ANYTHING YOU WANT TO HAPPEN AFTER VERIFICATION
}
else{
echo "Please go back and type the code exactly as shown.";
}
?>
<FONT style="BACKGROUND-COLOR: #ffffff">
PHP:
<?php
Header("Content-Type: image/png");
session_start();
$new_string;
session_register('new_string');
echo "<html><head><title>Verification Check</title></head>";
echo "<body>";
$im = ImageCreate(200, 40);
$white = ImageColorAllocate($im, 255, 255, 255);
$black = ImageColorAllocate($im, 0, 0, 0);
srand((double)microtime()*1000000);
$string = md5(rand(0,9999));
$new_string = substr($string, 17, 5);
ImageFill($im, 0, 0, $black);
ImageString($im, 4, 96, 19, $new_string, $white);
ImagePNG($im, "verify.png");
ImageDestroy($im);
echo "<img src=\"verify.png\">";
echo "<br><br>";
echo "Type the code you see in the image in the box below. (case sensitive)";
echo " <form action=\"formhandler.php\" method=post>";
echo "<input name=\"random\" type=\"text\" value=\"\">";
echo "<input type=\"submit\">";
echo "</form>";
echo "</body>";
echo "</html>";
?>