Introduction to mutual passing of values between js and php _ PHP Tutorial

Source: Internet
Author: User
Introduction to mutual passing of values between js and php. JS is the front-end language, PHP is the background language, and the front and back-end are often unclear at the beginning (I did it at the beginning, and now I am also committing a crime ), my original idea was to regard the former JS as the front-end language, and PHP as the background language. at the beginning of the year, there may often be situations where the front-end and back-end cannot be clearly identified (I did this at the beginning, at the same time, I used to think of the frontend and backend as two islands. they cannot cross. HTML is like a bridge, when you want to transfer the variable from one island to another, you only need to use this bridge.
Let me make a small summary:
1: How to upload the values in HTML to JS? The following is a file named 1.php.

The code is as follows:








JS, if you want to get the name value entered by the user in the text box, write

The code is as follows:


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.