The code is part of a captcha script.Take a look at how it works here http://www.web1marketing.com/resources/tools/quickcaptcha/ . Here is the code:
<?php
include "settings.php";
session_start();
$string = strtoupper($_SESSION['string']);
$userstring = strtoupper($_POST['userstring']); 
session_destroy();   
if (($string == $userstring) && (strlen($string) > 4)) {
    header("Location: $success");
    exit();
} else {
    header("Location: $failure");
    exit();
}
?> 
The error I am getting
Notice: Undefined index: string in /storage/ssd1/092/public_html/result.php on line 24
Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd1/092/public_html/result.php:24) in /storage/ssd1/092/public_html/result.php on line 32
 
    