HTML Call PHP Detailed

Source: Internet
Author: User
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 ";    ? >

========================================

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.