using PHP in external JS
<p>I have a big validation JS script. I want to put this script to be external JS.</p>

<p>Everything works fine with this, but in the JS i use cookie to handle the my user form junctions.</p>

<p>And besides, i use PHP in this JS. </p>

<p>If the JS in the html, then works. But if i put it to external, then no.</p>

<p>For example:</p>

<p>External JS:</p>

<pre><code>$(document).ready(function() {

     var test = $.cookie('tet');
     $.cookie('tet','8'); 

    &lt;?php
     if (isset($_SESSION['main_check_a'])) {
     echo "$.cookie('tet','1');";
    ?&gt;
}}
</code></pre>

<p>}</p>

<p>How can i pass this PHP code to my external JS?</p>
