January 14, 2008

Captchamatika

hehehe… isneg-iseng bikin security code buat form yang ntar-nya bisa di-aplikasi-in di macem2 form, entah form login, form registrasi, atopun form buku tamu… security code ini biasanya lebih dikenal dengan nama CAPTCHA, captcha sendiri bisa diartiin :

A CAPTCHA (IPA: /ˈkæptʃə/) is a type of challenge-response test used in computing to determine whether the user is human. The process involves one computer (a server) asking a user to complete a simple test which the computer is able to generate and grade, but not able to solve on its own. Because computers are unable to solve the CAPTCHA, any user entering a correct solution is presumed to be human.

Sumber : http://en.wikipedia.org/wiki/Captcha 

nah… captcha yang aku bikin ini emang berbasis Image, tapi ga pake tambahan titik atau garis dibelakangnya, en ga pake ngrubah pola en posisi karakter per karakter, klo captcha biasa user tinggal menuliskan apa yang diliat digambar, klo captcha yang ini user harus sedikit menggunakan kemampunannya berhitung, alias matematika…

jadi bisa dibilang captcha ini menggabungkan gambar dan matematika, makanya sama Pakdhe dikasih nama CapTchaMatika, hehehe…

fungsi imagenya diambil dari contoh fungsi dasar imagecreate-nya PHP.

(start PHP here)

header("Content-type: image/png");
$im = @imagecreate(110, 20)
    or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);

(end PHP here)

nah perubahannya di

"A Simple Text String"

yang diubah jadi variabel yang di-generate pake fungsi rand().

untuk versi lengkap dari captchamatika 0.1 bisa diambil

disini

Selamat Mencoba…. :D :D :D , and mohon kritik plus sarannya yah…


May 21, 2006

‘ register_globals = off ‘

Filed under: php
Comments (0)

when $GLOBALS; unavailable for form with method execution

it used to be register_globals = off, on apache web server and actually on file ‘php.ini’

a few month of confused is solved by a day of read ‘php_manual_en.chm’

if you using method ‘post’, change $GLOBALS["handle"] to $_POST["handle"] and if you using method ‘get’, change $GLOBALS["handle"] to $_GET["handle"], hope this could solve someone’s problem

hahaha, akhirnya beberapa permasalahan terselesaikan juga, and karena problem satu ini uda selese brarti permasalahan di http://itz12.t35.com juga terselesaikan..

and go check this out http://itz12.t35.com

news and guestbook fixed…. 


< Most Popular Posts />