Return to Snippet

Revision: 42263
at March 2, 2011 10:26 by GeekOfWeb


Initial Code
<?php
//guvenlik_resmi.php

//Tarayıcımıza oluşturduğumuz verinin resim( gif )olduğunu belirtiyoruz
header ('Content-type: image/gif');

//Session'a atadigimiz kodumuzu alalim
session_start ();
$Kod = $_SESSION ['guvenlikkodu'];

//Resmimiz için bir artalan ve font sekli
$resim = "security.gif";
$font = "trash.TTF";
$resimYap = imagecreatefromgif ( $resim );

// Yazi ve arka plan renklerini belirleyelim
//Arkadaki gri kod
$gri = imagecolorallocate ( $resimYap, 170, 170, 170 );
//Asil kod 
$siyah = imagecolorallocate ( $resimYap, 0, 0, 0 );

//Artalan resmimizin üstüne kodumuzu yazalım
imagettftext ( $resimYap, 30, 10, 29, 39, $gri, $font, $Kod );
imagettftext ( $resimYap, 20, 6, 8, 35, $siyah, $font, $Kod );

//Son islem olarak resim yap
imagegif ( $resimYap );
//önbellegi temizle
imagedestroy ( $resimYap );
?>

Initial URL


Initial Description
Written by Zafer Korucu <www.zaferkorucu.com>

Initial Title
GuvenlikdKodu Class - Resim yapalim

Initial Tags


Initial Language
PHP