Why would the PHP code below, delete some CAPTCHA images and allow several other images to remain on the server?
psuedo kod
//process_form.php
PHP
session_start()
$radiobutton = '';
$captcha_set = false;
IF POST SUBMIT
IF empty text1 && empty text2
echo error msg, include HTML FORM
ELSE IF empty radiobtn
echo error msg, include HTML FORM
ELSE IF
isset POST[phrase] isstring POST[phrase] isset SESSION[phrase]
strlen POST[phrase] > 0 strlen SESSION[phrase] > 0
POST[phrase] == SESSION[phrase]
$captcha_set = true;
if ($captcha_set)
{
unset($_SESSION['phrase']);
unlink(sha1(session_id()) . '.png');
}
SQL INSERT
ELSE
echo error msg, include HTML FORM
ELSE
include HTML FORM
/PHP
HTML FORM
PHP
Require Once Text/Captcha.php
PEAR Capthca Options
/PHP
HTML
FORM
PHP
echo '<img src="' . sha1(session_id()) . '.png?' . time() . '" />';
/PHP
/FORM /HTML