Location: PHPKode > projects > Backlink Generate and Submit PHP Script > captcha.php
<?php
session_start();
/*******************************************************************************
*  Title: Backlinks Generation and Submission Free PHP Script - Captcha Script
*  Version: 0.1 @ Feb 10, 2011
*  Author: Hrishikesh Joshi
*  Website: http://www.wallads.info
*  Demo Website:  http://demo.wallads.info
********************************************************************************
*  COPYRIGHT NOTICE
*  Copyright 2011 Hrishikesh Joshi. All Rights Reserved.
*
*  This script may be used and modified free of charge by anyone
*  AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
*  By using this code you agree to indemnify Hrishikesh Joshi from any
*  liability that might arise from its use.
*
*  Selling the code for this program, in part or full, without prior
*  written consent is expressly forbidden.
*
*  Obtain permission before redistributing this software over the Internet
*  or in any other medium. In all cases copyright and header must remain
*  intact. This Copyright is in full effect in any country that has
*  International Trade Agreements with the United States of America or
*  with the European Union and with the India.
*******************************************************************************/



/***************  Do not edit the script below (Except color for the Captcha Font) *************/


$string = '';

for ($i = 0; $i < 5; $i++) {
	// this numbers refer to numbers of the ascii table (lower case)
	$string .= chr(rand(97, 122));
	}

$_SESSION['rand_code'] = $string;

$dir = 'fonts/';

$image = imagecreatetruecolor(73, 17);
$black = imagecolorallocate($image, 0, 0, 0);
$color = imagecolorallocate($image, 200, 100, 90); // red color
$white = imagecolorallocate($image, 255, 255, 255);

imagefilledrectangle($image,0,0,399,99,$white);
imagettftext ($image, 12, 0, 10, 13, $color, $dir."arial.ttf", $_SESSION['rand_code']);

header("Content-type: image/png");
imagepng($image);

?>
Return current item: Backlink Generate and Submit PHP Script