Hi!
I see. But I want to do other thing:
In this type of our site, index.php makes a document and adds there some HTMs. Now I want to add AJAX scripts in the document, so some HTMs will be capable to be added by JavaScript. And sometimes these HTMs have PHP scripts inside.
- When they are added by index.php they normally work, because index.php is on the server and the HTMs are processed on the server.
- When HTMs are added by JavaScript PHP scripts inside them can't work, because they come through XMLHttpRequest and "enter" the document in the browser, which can't understand PHP.
Thus, these PHP scripts work only when they are processed on the server. My friend suggested to use full path in the Request (such as
http://127.0.0.1/asd.htm). But it didn't help. And XMLHttpRequest object takes links to text file or XML only. I don't know how to run a PHP script on the server via JavaScript before receiving it to browser. (Maybe here is the solution...)