How to call php page from html

Release: 2023-02-28 07:58:02
Original
4142 people have browsed it

How to call php page from html

html itself cannot handle dynamic requests. To accomplish this, JavaScript is generally used. When generating a static web page, you can generate a corresponding JavaScript file reference for the HTML page based on the database ID.

You cannot directly call php files in static pages, but you can use js calling method to call php files, and you can also use ajax to call php files.

Give a simple example to illustrate: Use the following code in page a.html to pass the action=test parameter to b.php.

Javascript code is as follows:

 在b.php中有这样一段PHP代码: 
Copy after login

Recommended:php server

The above is the detailed content of How to call php page from html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!