用post請求的話,可以和get一起使用,但是如果用get請求提交的話,會用form里面的參數替換掉地址欄原有參數,有沖突
get產生一個數據包,post產生兩個數據包
1.url中用get添加參數,表單用get提交
如下所示,表單采用get方法,url中的參數urlpara會被覆蓋掉。實際提交的鏈接為
https://www.runoob.com/try/demo_source/www.baidu.com?user=zhangsan&password=123

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鳥教程(runoob.com)</title> </head> <body> <form action="www.baidu.com?urlpara=3", method="get"> Username: <input type="text" name="user"><br> Password: <input type="password" name="password"> <input type="submit" name="password"> </form> <p><b>注意:</b>用post請求的話,可以和get一起使用,但是如果用get請求提交的話,會用form里面的參數替換掉地址欄原有參數,有沖突 </p> </body> </html>
2. url用get,表單用post
url中的參數還保留着
https://www.runoob.com/try/demo_source/www.baidu.com?urlpara=3
