Click image to view larger format

- Verify if the verification code is set on session (isset($_SESSION['captchacode']))
- Verify if the verification code length is greater than 0
- Verify if the verification code equals the code entered by the user
- Unset the code from the session after finishing with all the verifications above

function CurrentURL()
{
$url = 'http';
if ($_SERVER["HTTPS"] == "on")
{
$url .= "s";
}
$url .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
{
$url .= $_SERVER["SERVER_NAME"].":".
$_SERVER["SERVER_PORT"].
$_SERVER["REQUEST_URI"];
}
else
{
$url .= $_SERVER["SERVER_NAME"].
$_SERVER["REQUEST_URI"];
}
return $url;
}
?>