Nicholas Cheek

LITTLE ROCK WEB DEVELOPER

 <?php
    
    // load captcha using web service
    $url = 'http://api.textcaptcha.com/api id';

try {
$xml = @new SimpleXMLElement($url,null,true);
} catch (Exception $e) {
// if there is a problem, use static fallback..
$fallback = '<captcha>'.
'<question>Is ice hot or cold?</question>'.
'<answer>'.md5('cold').'</answer></captcha>';
$xml = new SimpleXMLElement($fallback);
}
// display question as part of form
$question = (string) $xml->question;
// ... [snip] ...
// store answers in session
$ans = array();

foreach ($xml->answer as $hash) {
    
    echo $hash;
        echo "<br />";

}
$ans[] = (string) $hash;
$session->question = $question;

echo $session->question;

LITTLE ROCK WEB DEVELOPER

Living the dream.

nick@nicholascheek.com