1.之前就是用過,在form表單post提交時,action的url傳遞get參數(shù),服務器端是能獲取到的:
- <?php
- print_r($_GET);
- print_r($_POST);
- ?>
-
- <form action="get_post.php?id=100" method="post">
- 姓名:<input type="text" name="name" /><br>
- 年齡:<input type="text" name="age" /><br>
- <input type="submit" value="提交" />
- </form>
2.但是如果你的form提交類型為get,url中傳遞的參數(shù)卻是獲取不到的:
- <?php
- /**
- *測試get和post提交
- *@link(http://www.)
- */
- print_r($_GET);
- print_r($_POST);
- ?>
-
- <form action="get_post.php?id=100" method="get">
- 姓名:<input type="text" name="name" /><br>
- 年齡:<input type="text" name="age" /><br>
- <input type="submit" value="提交" />
- </form>
|