Transferred from: http://my.oschina.net/jiec/blog/196153
I. Post-pass value
The post pass value is a method for HTML <form> form jumps, which is easy to use. For example:
The action in the form fills in the URL path of the jump page, which is filled in with the post method. When the submit button is pressed in the form form, the contents of name in the form are uploaded to the filled URL, which can be obtained by $_post[' name ', for example:
<?php$a=$_post[' name1 '; $b =$_post[' name2 '];? >
Here is a handy tip, when the type is selected as ' hidden ' in the input tag, the input tag is hidden and not displayed on the page, but the input tag is in the form and has a name and value value, which will also follow the commit button to pass in the past. This hidden tag can pass something that you don't want to show.
Two. Get Pass value
The get value is passed by following the URL, and then the URL jumps when the page jumps. Used in the use of <a> tags. For example:
<a href= ' Delete.php?id=value ' > Point me Jump </a>
After jumping into xxx.php, you can get the value passed by $_get[' id '. The Get method is commonly used for URLs that are intended to delete or read a PHP file of an ID.
Three. Session Pass value
Session is a global variable, often used to save user ID and other common data after user login. Once saved to the session, the other pages can be obtained through the session, session use to open session:
<?php//session Assignment Value session_start (); $_session[' one ']=value1; $_session[']=value2; SESSION value read: $one = $_session[' one '); SESSION Value Destruction unset ($_session[' one ');? >
The above three kinds of methods are commonly used, you can refer to the use.
[To] php three common ways to pass values between different pages