Why can't a submit button send to PHP and jQuery at the same time?
<p>I have this code.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form action = "" method = "POST" id = "form"&gt;
        &lt;img src = "circle.gif" id="loading" style="display:none; "/&gt;
        &lt;input type="text" name = "text2"&gt;
        &lt;input type="submit" name="submit2" value="Send"&gt;
    &lt;/form&gt;
&lt;?
if (isset($_POST['submit2'])){
    echo $_POST['text2'];
}
?&gt;
    &lt;script&gt;
        $('#form').submit(function(e) {
            $('#loading').show();
            return false;
        });
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I want to store in my db the value written in the textbox <strong>using PHP</strong>, and while it's being saved, I want to show a gif using jQuery, once the page is loaded, this gif should be removed.</p>

<p>Then, If I don't comment nothing, gif appears when submit button is submitted but echo fails.</p>

<p>If I comment the jQuery script, PHP echoes the vale written.</p>

<p>If I comment the PHP script, gif is shown but no echo of course...</p>

<p>How could I do what i'm asking. I know that my full script does until only showing the gif, but this without this I can't continue.</p>
