Hi,
I read several examples, tried them all out - and nothing works! Driving me crazy - completely insane! Maybe you guys can help

My problem is simple:

file B.html includes this line:
Code:
<script type="text/javascript" src="B.js" defer="defer"></script>
file B.js is a regular JS file, yet I need to insert a PHP function in it (yeah - I know it will operate server-side before the page reaches the browser). I did something like:
Code:
(some js code)
var user_id = <?php $a=100; $b=200; $c=$a+$b; echo($c);?>;
alert("Your user ID is:" + user_id);
(some more js code)
(What I expect is the browser to see the line as: var user_id = 300; )

Doesn't work. Renaming B.js to B.php did nothing.
What am I doing wrong?

Thanks!