title: include php in a js file
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3943198/parse-a-javascript-file-through-php">Parse a JavaScript file through PHP</a>  </p>
  </blockquote>
  
  
  
  <p>I have some pretty long string variables in javascript that I instantiate in a .js file that way I can use them in multiple files, and also just so it doesn't muddle up the pages by being super long. However, I want to echo out some php into the .js file (so I can use a filepath specified in my php) and put it into the variable.</p>
  
  <p>I know that if it was in a normal html page I could just do <code>&lt;?php echo "foo"; ?&gt;</code> and it would work allright. But, in the js file it seems to ignore it. The js file currently instantiates a variable and an associative array that store html forms so I can put them on the page depending on some user input. </p>
  
  <p>I need to echo out the php file path onto the action part of the form. THe reason for doing this is so I only have to change the file path once if I go back and modify my code. However the js file will either stick the actual text () in my variable, or the form won't load.</p>
  
  <p>Any help would be appreciated and if you need some more info, feel free to ask. Thanks alot!</p>