Introduction to mutual passing of values between js and php

Source: Internet
Author: User
This article provides a detailed analysis of the problem of mutual passing of values between js and php. For more information, see if JavaScript is the frontend language and PHP is the background language, at the beginning of school, there will often be situations where the frontend and backend are unclear (I was like this at the beginning, and I am still committing crimes). my original idea was to regard the frontend and backend as two islands, they cannot be crossed. HTML is like a bridge. when you want to transfer the variables on one island to another, you only need to use the 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.