Example of passing values between php pages-PHP source code

Source: Internet
Author: User
Ec (2); there are many methods for passing values. The parameter value can be: urs. php? Id1 takes the parameter form. This is the main method for passing values between pages. The request and get parameters are used to receive values. from form pass value: mainly receives request pass value post, get & nbsp; to receive, for the from tag, you can select get or post to pass the value through the url. You can also use ajax to transfer the value to post or get. session pass value: This script ec (2); script

There are many methods for passing values,
Parameter Value: can it be urs. php? Id = 1 is in the parameter format. This is the main way to pass values between pages. request and get are used to receive values.
From form pass value: mainly receives request pass value post, get to receive, for the from tag, you can select get or post to pass the value through the url. You can also use ajax to transfer the value to post or get.

Session value transfer: This is generally used for user login, server global variables, generally do not need to pass the value before the page
Cookie value passing: Save the content on the client,

The commonly used page transfer value is mainly the parameter data transmission value from the form to pass the value.

How many instances can be created now?
*/
// First use the page parameter to pass the value to the instance

?>

Click me
// The output value is 1.

Use form to pass values

5


If ($ _ GET)
{
Echo 'get passed value', $ _ get ['action'];
}
Else
{
Echo 'Post passed value', $ _ post ['action'];
}
// This article was originally published at the first stop of www.111cn.net Chinese WEB.

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.