PHP Sessions & Forms
<p><strong>Edit</strong></p>

<p><strong>How can I rewrite this PHP code for POST[ 'phrase' ] == session[ 'phrase' ] ?</strong> </p>

<pre><code>psuedo-code

//process_form.php

PHP
session_start()

IF POST SUBMIT
    IF empty text1 &amp;&amp; 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] &gt; 0 strlen SESSION[phrase] &gt; 0 
        POST[phrase] == SESSION[phrase]

        SQL INSERT

    ELSE
        echo POST[phrase]
        echo SESSION[phrase]

ELSE
    include HTML FORM
/PHP
</code></pre>

<p>&nbsp;</p>

<p><strong>FORM</strong></p>

<pre><code>PHP
PEAR CAPTCHA Settings ...
require_once 'Text/captcha.php'
/PHP

HTML
FORM METHOD POST process_form.php
    text1
    text2
    radio
    PHP echo [ img src= sha1(session_id()) . '.png?' . time() ] /PHP
    submit 
/HTML
</code></pre>
