超全局变量数组get post requerst resver的使用规则
生活随笔
收集整理的這篇文章主要介紹了
超全局变量数组get post requerst resver的使用规则
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
超全局變量數組的概念不同于全局變量,這里我主要說的是用來接收信息用的。其實在以往已經大量使用了
首先:get數組,速度較好,但是相對不是很安全。
post數組,可以接收大的數據量,較安全,最常用。
request數組,可以接收get和post的數據,但是最不建議,不安全。
resver數組,這是現實客戶端信息用的,并不用來接收數據。
下面是代碼實例:
<html><head><title>測試</title><meta?charset="utf-8"/></head><body><form?action="process_get.php"?method="POST"><br/>用戶名:<input?type="text"?name="name"><br/>密碼:<input?type="password"?name="password"><br/><input?type="radio"?name="city"?value="beijing">北京<br/><input?type="radio"?name="city"?value="shanghai">上海<br/><input?type="radio"?name="city"?value="guangzhou">廣州<br/><input?type="file"?name="myfile"?value="上傳文件"><br/><textarea?name="hobby"></textarea><input?type="submit"?value="提交用戶數據"></form></body> </html><?php $name=$_POST['name']; $password=$_POST['password']; $city=$_POST['city']; $hobby=$_POST['hobby']; echo?"賬戶信息:<br/>"; echo?"姓名:".$name."<br/>"; echo?"密碼:".$password.'<br/>'; //echo?"所在地:".$city.'<br/>'; echo?"愛好:".$hobby."<br/>"; if(empty($_POST['city'])){echo?"沒有收到城市信息"; }else{echo?"所在地:".$city.'<br/>'; } //header("Location:?http://www.baidu.com"); ?>尊重原創,禁止非csdn轉載。
本文來自:愛好Linux技術網
轉載于:https://blog.51cto.com/9820245/1624086
總結
以上是生活随笔為你收集整理的超全局变量数组get post requerst resver的使用规则的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 详解EMC测试国家标准GB/T 1762
- 下一篇: 「硬见小百科」30个EMC标准电路分享