Possible Duplicate:
Parse a JavaScript file through PHP
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.
I know that if it was in a normal html page I could just do <?php echo "foo"; ?>
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.
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.
Any help would be appreciated and if you need some more info, feel free to ask. Thanks alot!