This article is mainly to share with you HTML call PHP detailed,
HTML itself is unable to handle dynamic requests, to accomplish this, it's usually JavaScript. In generating a static Web page, a corresponding JavaScript file reference can be generated to the HTML page based on the database ID. For example, if the page is 123.html, then this page generates a
<script type= "Text/javascript" src= "click.php?id=123" ></script>
Then in the click.php this page to follow the PHP syntax to deal with the operation of the database on the line.
==============================================
In static pages, PHP files cannot be called directly, but PHP files can be invoked using JS calls, and PHP files can also be invoked using AJAX.
As a simple example, the following code is used in page a.html to pass action=test parameters to b.php.
The JavaScript code is as follows:
<script type= "Text/javascript" src= "B.php?action=test" ></script>
There is a PHP code in b.php:
<?php $action =$_get[' action ']; echo "document.write ('". $action. "); n "; ? >
========================================