How to execute a php header script from javascript?
<p>I have the following script <code>validation.php</code></p>

<pre><code>&lt;?php
if(!isset($_SESSION['userId'])){
    session_destroy();
    header('Location: home.php');
    exit;    
}
?&gt;
</code></pre>

<p>I would like to execute this script every time someone clicks a button in the <code>#main-display</code></p>

<pre><code>$("#main-display").on('click', 'button', function (event){
    //some code in here
});
</code></pre>

<p>How would I go about doing this?  </p>
