View file code.php

File size: 712B
<?php
define('_CMEX_', 1);
require 'core/core.php';

if( !isset($_SESSION['code']) ) exit;

$_SESSION['code'] = (string)$_SESSION['code'];

$image = imagecreate(222, 25);
$background_color = imagecolorallocate($image, 20, 20, 0);
$color = imagecolorallocate($image, 255, 255, 255);

imagechar($image, rand(3, 5), rand(3, 8), rand(3, 10), $_SESSION['code']{0}, $color);
imagechar($image, rand(3, 5), rand(17, 22), rand(3, 10), $_SESSION['code']{1}, $color);
imagechar($image, rand(3, 5), rand(31, 36), rand(3, 10), $_SESSION['code']{2}, $color);
imagechar($image, rand(3, 5), rand(45, 50), rand(3, 10), $_SESSION['code']{3}, $color);

header('Content-Type: image/gif');
imagegif($image);
imagedestroy($image);
?>