<?php session_start(); LBD_HttpHelper::FixEscapedQuerystrings(); LBD_HttpHelper::CheckForIgnoredRequests(); // There are several Captcha commands accessible through the Http interface; // first we detect which of the valid commands is the current Http request for. if (!array_key_exists('get', $_GET) || !LBD_StringHelper::HasValue($_GET['get'])) { LBD_HttpHelper::BadRequest('command'); } $commandString = LBD_StringHelper::Normalize($_GET['get']); $command = LBD_CaptchaHttpCommand::FromQuerystring($commandString); switch ($command) { case LBD_CaptchaHttpCommand::GetImage: GetImage(); break; case LBD_CaptchaHttpCommand::GetSound: GetSound(); break; case LBD_CaptchaHttpCommand::GetValidationResult: GetValidationResult(); break; default: LBD_HttpHelper::BadRequest('command'); break; } // Returns the Captcha image binary data function GetImage() { // saved data for the specified Captcha object in the application $captcha = GetCaptchaObject();