There are many ways to pass values,
Parameter Pass value: Can be urs.php?id=1 with parameter form, this is the page compares the main transfer value way, receive value with Request,get.
From table conveys value: Main receive request pass value Post, get to receive, from tag can select Get or post through URL value is get also can use AJAX transfer value can choose Post or get.
Session Pass Value: This is usually done when the user login, server global variables, generally not in the page before the transfer value
Cookie Pass Value: Save content on client,
Our commonly used page transfer value is mainly the parameter transfer value from the table conveys value.
Now let's do a few examples.
*/
Use page parameter to pass value instance first
?>
<a href= "B.php?action=1" > Click me </a>
Output value is 1
Use form to pass values
<form action= "b.php" method= "Get" >
<input name= "Action" type= "text" value= "5" >
<input type= "Submit" value= "Submit"/>
</form>
We got a value of 5.
<form action= "b.php" method= "POST" >
<input name= "Action" type= "text" value= "5" >
<input type= "Submit" value= "Submit"/>
</form>
?
if ($_get)
{
Echo ' Get pass value ', $_get[' action '];
}
Else
{
Echo ' POST pass value ', $_post[' action '];
}
This article is original in Www.111cn.net China Web first stop, reprinted annotated Source