9)用request方式

一个带有html的代码:

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn">
 3 <head>
 4     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 5     <title>网页标题</title>
 6     <meta name="keywords" content="关键字列表" />
 7     <meta name="description" content="网页描述" />
 8     <link rel="stylesheet" type="text/css" href="" />
 9     <style type="text/css"></style>
10     <script type="text/javascript"></script>
11 </head>
12 <body>
13 <form  action="c.php?a=5&b=10"  method="POST" >
14     项目1: <input type="text"   name="uName"   />
15     项目2: <input type="password"   name="uPswd"   />
16     项目3: <input type="text"   name="a"   />
17     <input type="submit"  value="提交"  />
18 </form>
19 </body>
20 </html>

注意上面的那个    c.php?a=5&b=10    这个a和b是通过get方式得到数据:

            然后那个php代码:

1 echo $_GET['a'];
2  echo '<br>';
3  echo$_GET['b'];

              结果展示:

1 5
2 10
原文地址:https://www.cnblogs.com/xiaoyoucai/p/7306941.html