PHP and JS Interactive sample code

Source: Internet
Author: User
All of PHP's applications are performed through a Web server (such as IIS or Apache) and a PHP engine program that explains how the process works:

(1) When the user enters the file name of the PHP page to be accessed in the browser address, then enter will trigger the PHP request and transfer the request to a PHP-enabled Web server.

(2) The Web server accepts this request and makes a decision based on the suffix if it is a PHP request, the Web server pulls the PHP application that the user wants to access from the hard disk or memory and sends it to the PHP engine program.

(3) The PHP engine program (typically PHP.exe) will scan the Web server's files from start to finish, read from the background according to the commands, process the data, and dynamically generate the corresponding HTML page.

(4) The PHP engine returns the generated HTML page to the Web server. The Web server then returns the HTML page to the client browser.

So if PHP is to pass a value to the HTML JS script, how to do? You can define the variables before you need them, as in the following example:

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.