I have this code:
Why does this not write "bar" into my text file, but alerts "42"?
foo is not evaluated on the server side and therefore its value can't be written to a file on the server.
The best way to think about this process is as if you're generating a text file dynamically. The text you're generating only becomes executable code once the browser interprets it. Only what you place between
<?php tags is evaluated on the server.
In web application every task execute in a manner of request and response.
Client side programming is with html code with Java script and its frameworks, libraries executes in the internet explorer, Mozilla, chrome browsers. In the java scenario server side programming servlets executes in the Tomcat, web-logic , j boss, WebSphere severs