assigning the result of a jsp confirm box to a php variable
<pre><code>//this is in php.
function msgbox($msg, $type)
    {
    if ($type == "alert")
        {
        // Simple alert window
        ?&gt; &lt;script language="JavaScript"&gt; alert("&lt;? echo $msg; ?&gt;"); &lt;/script&gt; &lt;?
        }
    elseif ($type == "confirm")
        {
        // Enter Confirm Code Here and assign the $result variable for use
        // Should include "OK" and "Cancel" buttons.
        ?&gt;
           &lt;script language="JavaScript"&gt;
           if (confirm("&lt;? echo $msg; ?&gt;"))
                {
                &lt;? $result == "ok"; ?&gt;
                }
           else
                {
                &lt;? $result == "cancel"; ?&gt;
                }
           &lt;/script&gt;
        &lt;?
        }
    }



if ($page_title-&gt;exists())

{msgbox("page exists,do you want to delete", "confirm");

}
if ($result == "ok")

 //code.. 
</code></pre>

<p>The problem is that <code>$result</code> is not reading the value from the confirm box i think because the if clause is not being executed and the program flow is going where it would go without the if clause.                    </p>
