Вход Регистрация
Файл: Source/inc/verify.php
Строк: 42
<?php
/*
 * Script name: Points4Prize
 * Author: Soft Projects
 * Date created: 15/07/2015
 */
 
session_start();

// generate 5 digit random number
$rand = rand(111, 999);
//999999999
//100000000

// create the hash for the random number and put it in the session
$_SESSION['image_random_value'] = md5($rand);

// create the image
$image = imagecreate(65, 30);

// use white as the background image
$bgColor = imagecolorallocate ($image,  69, 69, 69);

// the text color is black
$textColor = imagecolorallocate ($image, 0xff, 0xff, 0xff);

// use font for the string
$font = 'Autumn.ttf';

// write the random number
imagettftext($image, 17, 0, 12, 25, $textColor, $font, $rand);

// send several headers to make sure the image is not cached
// taken directly from the PHP Manual

// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");

// send the content type header so the image is displayed properly
header('Content-type: image/jpeg');

// send the image to the browser
imagejpeg($image);

// destroy the image to free up the memory
imagedestroy($image);
?>
Онлайн: 2
Реклама