 <p>I think this must works, put your php name file in the url and add the done() function to your code</p> <pre><code>&lt;script type="text/javascript"&gt; $("#submit").click(function(){ var foo = $(this).val(); $.ajax({ url:'YourPhpNameFile.php', type: "POST", data: { 'name':foo }, }).done(function( msg ) { alert('success'); }); }); &lt;/script&gt; </code></pre> <p>or put</p> <pre><code>location.reload(); </code></pre> <p>on the success() function.</p> <p>Hope this helps you! Greetings.</p>