Contact Form |
|
|
Name* |
: |
|
Email* |
: |
|
Contact Number |
: |
|
Description |
: |
|
Enter the code as shown* |
: |
|
function generatePin($value)
{
return substr($value,4,4);
}
$_SESSION['admin_pin_value']=md5(rand(2,99999999));
$encodedPin =generatePin($_SESSION['admin_pin_value']);
## create an image not a text for the pin
$font = 6;
$width = ImageFontWidth($font) * strlen($encodedPin);
$height = ImageFontHeight($font);
$im = @imagecreate ($width,$height);
$background_color = imagecolorallocate ($im, 219, 239, 249); //cell background
$text_color = imagecolorallocate ($im, 0, 0,0);//text color
imagestring ($im, $font, 0, 0, $encodedPin, $text_color);
imagejpeg($im,"tmp/tmp_pin_".$_SESSION['admin_pin_value'].".jpg");
echo "";
imagedestroy($im);
?>
|
|
(*) fields are mandatory |
|