session_start(); //<-must start SESSION if not done before include 'class.captcha.php'; if($_POST['sent']=='true') { $captcha= new Captcha(); if($captcha->isValid()) { echo 'Correct code !'; } else { echo 'Invalid code :('; } } else { // == FORM $thisFile=$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; if(!strstr($_SERVER['QUERY_STRING'], 'PHPSESSID')) $thisFile.='&PHPSESSID='.session_id(); echo '
'; } ?>