job0107, here is a test that will prove to you that the PHP code on the page is executed when the page is requested and not as the result of the execution of the javascript -
Reverse the order of the two alert statements, so that the one containing the PHP "function call" is last.
Browse to the page and let the first alert statement execute and display the "You just created a file..." (ignoring what it is saying.)
Examine the web server folder and note that the .txt file has been created. You can also view the source of the page in the browser at this point and note that it already contains the output from the echo statement in the php function code, not a reference to the PHP function call.
Click the OK button on the first alert.
Click the OK button on the second alert (with the PHP "function call" in it.)
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
|