-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy_codegen.php
21 lines (16 loc) · 915 Bytes
/
my_codegen.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?
$nomer=$_REQUEST['nomer'];
{// ÷òî áû íå êýøèðîâàëàñü êàðòèíêà
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // äàòà â ïðîøëîì
header("Last-Modified: " . gmdate("D, d M Y H:i:s", 10000) . " GMT"); // 1 ÿíâàðÿ 1970
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false); // åùå ðàç, äëÿ íàäåæíîñòè
header("Pragma: no-cache"); // HTTP/1.0
header("Content-Type:image/png");
}
$im = imagecreatefrompng ('my_codegen/codegen.png'); // çàãðóæàåì ôîí
$color = imagecolorallocate($im, rand(0, 200), 0, rand(0, 200)); // öâåò òåêñòà
imagettftext ($im, 15, rand(-4, 4), rand(10, 45), rand(20, 35), $color, 'my_codegen/trebucbd.ttf', $nomer); //ñàì òåêñò â ïðåäåëàõ êàðòèíêè
ImagePNG ($im); // âûâîä èçîáðàæåíèÿ
ImageDestroy ($im); // Îñâîáîæäàåì ïàìÿòü
?>