1. I used it before. When submitting form post, the url of the action passes the get parameter, which can be obtained by the server:
| The code is as follows: |
Copy code |
<? Php Print_r ($ _ GET ); Print_r ($ _ POST ); ?> <Form action = "get_post.php? Id = 100 "method =" post "> Name: <input type = "text" name = "name"/> <br> Age: <input type = "text" name = "age"/> <br> <Input type = "submit" value = "submit"/> </Form> |
2. If your form submission type is get, the parameters passed in the url cannot be obtained:
| The code is as follows: |
Copy code |
<? Php /** * Test get and post submission. * @ Link (http://www.111cn.net) */ Print_r ($ _ GET ); Print_r ($ _ POST ); ?> <Form action = "get_post.php? Id = 100 "method =" get "> Name: <input type = "text" name = "name"/> <br> Age: <input type = "text" name = "age"/> <br> <Input type = "submit" value = "submit"/> </Form> |