Image button in PHP doesn't work properly
<p>I have an image button on my PHP page. I need to execute a piece of code when this button is clicked. I'm trying the following.</p>

<pre><code>&lt;?php 
    if(isset($_POST['btnSubmit']))
    {
        echo "Do some stuff.";  
    }
?&gt;

&lt;input type="image" name="btnSubmit" id="btnSubmit" src="images/btnsubmit.gif"&gt;
</code></pre>

<p>When I click the button <code>btnSubmit</code>, the <code>if</code> condition should be evaluated to true and the message within the <code>if</code> body should be echoed to the web page but the condition is never satisfied when I click this button. </p>

<p>When I change the button type to <code>type='submit'</code>, it works. I need to use the <code>type='image'</code> anyhow. How can I do that?</p>
