<?php
If (empty($_GET['sid']))die();
//----------
$sid = strip_tags($_GET['sid']);
$res = @session_id($sid);
//----------
If (FALSE===$res) die();
session_start();
//----------
If (empty($_SESSION['code']))die();
//----------
$image=imageCreateFromPng("regimg.png");
//$colour=imageColorAllocate($image,rand(1,255),rand(1,255),rand(1,255));
$colour=imageColorAllocate($image,0,255,0);
imageTTFText($image,17,12,9,26,$colour,getcwd()."/font.ttf",$_SESSION['code']);
header("Content-type: image/png");
imagepng($image);
?>