10-21-2008, 10:17 PM
|
#1 (permalink)
|
|
Super Moderator
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
|
why do i get error on this ?
PHP Code:
<?php session_start(); //imagecreatefrompng :: create a new image //from file or URL $img = imagecreatefrompng('black.png'); //displaying the random text on the captcha $numero = rand(100, 999); $_SESSION['check'] = $numero; //The function imagecolorallocate creates a //color using RGB (red,green,blue) format. $white = imagecolorallocate($img, 255, 255, 255); imagestring($img, 10, 8, 3, $numero, $white); header ("Content-type: image/png"); imagepng($img); ?>
and then in the reg page
you do this
session_start();
PHP Code:
if(($_POST['check']) == $_SESSION['check']) { echo 'Input OK'; }else{ echo 'Input Wrong'; }
but i get..
echo 'Input Wrong';
|
|
|
|