javascript - Can PHP run after the page is loaded? -
Then PHP is executed server-side. But is PHP possible to run after the page is loaded?
For example, if I have a value (put in a file, I say) that has changed every second when I press a button that uses Javascript then get that value To ask PHP to do, it shows what is currently the price or what is on page load?
I think you will need to get one of the diagrams that shows the original HTTP and web How the server works. This is explained in plain words from here, you will understand more.
In the simplest possible case, you can type the address, and get a web page with its contents, because In a less simple way, think of it in this way. Basically, if a page happens during a fresh phase, (which means that you have made a few clicks and waiting for the data to return), it means that the feedback / loads from the web server If PHP is not installed as a module in the web server, then the only thing that is waiting / loading (in many cases) is plain HTML content On the other side, if we Ante that you have a file AJAX (Asynchronous JavaScript and XML) is a technology that uses JavaScript, so that you can send the request and receive the response without loading the page. This is often done by using the browser XHR object. So, there is no secret in this whole Shebang. The above steps can be summarized only in the request / response your browser and a The connection between the web server is located somewhere in the world.
Plain HTML
with PHP < / H3>
index.php name of your server, and install PHP, so in this case, the web server to which the
& lt ;? Php? & Gt; Looks in the middle of , it sends the first to the PHP interpreter, wait for it until PHP does not spell it and only sends it back to the server.
& lt ;? Php echo1 + 1; ? & Gt; So, in the above case, the webserver (eg: Apache, NGNX) does not care whether the opening and closing tag is inside, and sends the whole code to the PHP interpreter, and PHP Calculates that script according to the way it understands and only returns the computed results back to the server, as the plain HTML. In this case the number
2
Role of AJX
index.php to the browser if
Comments
Post a Comment