View file wip-site-portal/src/img.php

File size: 762B
<?
header('Content-type: image/gif');

$word = false;
while(strlen($word)<2) $word .= mt_rand(0, 9);

$sess=intval($_SERVER['QUERY_STRING']);

if(strlen($sess)!=6) exit;

require('ini.php');

$link = connect();

mysql_query("select id from wip_regs where ip='$addr' and soft='$agent';");

if(mysql_affected_rows()<1) mysql_query("insert wip_regs set ip='$addr', soft='$agent', word='$word', sess='$sess';");
else mysql_query("update wip_regs set word='$word', sess='$sess' where ip='$addr' and soft='$agent';");

$img = imagecreate(25, 23);
$bgc=imagecolorallocate($img, 0, 0, 0);
$color=imagecolorallocate($img, 255, 255, 255);

imagettftext($img, 12, 45, 10, 23, $color, 'crystal.ttf', $word);

imagegif($img);
imagedestroy($img);
?>