1.$_REQUEST
默认情况下包含了 $_GET,$_POST 和 $_COOKIE 的数组,代码如下:
- <?php
- $_GET['foo'] = 'a';
- $_POST['bar'] = 'b';
- var_dump($_GET); // Element 'foo' is string(1) "a"
- var_dump($_POST); // Element 'bar' is string(1) "b"
- var_dump($_REQUEST); // Does not contain elements 'foo' or 'bar'
- ?>
注:它的速度比其它的要慢一些
2. $_GET
$_GET 变量用于收集来自 method="get" 的表单中的值,从带有 GET 方法的表单发送的信息,对任何人都是可见的(会显示在浏览器的地址栏),并且对发送的信息量也有限制,最多 100 个字符。
实例代码如下:welcome.php?name=Peter&age=37
welcome.php" 文件现在可以通过 $_GET 变量来获取表单数据了,请注意,表单域的名称会自动成为 $_GET 数组中的 ID 键,代码如下:
- Welcome <?php echo $_GET["name"]; ?>.<br />
- You are <?php echo $_GET["age"]; ?> years old!
注:数据量不能过大最多只能100个字符或2kb
3. $_POST
$_POST 变量是一个数组,内容是由 HTTP POST 方法发送的变量名称和值。
$_POST 变量用于收集来自 method="post" 的表单中的值。从带有 POST 方法的表单发送的信息,对任何人都是不可见的(不会显示在浏览器的地址栏),并且对发送信息的量也没有限制,代码如下:
- <form action="welcome.php" method="post">
- Enter your name: <input type="text" name="name" />
- Enter your age: <input type="text" name="age" />
- <input type="submit" />
- </form>
selcome.php文件,代码如下:
- Welcome <?php echo $_POST["name"]; ?>.<br />
- You are <?php echo $_POST["age"]; ?> years old!
注:比get要好很多数据处理量大同时大多用于表单,三区别在于$_REQUEST可以获取$_GET和$_post的数据,但是效率相对于前二者是要慢些,为什么慢我想大家用脚指都能想明白的,这里就留下大家思想吧。
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
波比源码 » php中$_GET,$_POST,$_REQUEST用法与区别分析
波比源码 » php中$_GET,$_POST,$_REQUEST用法与区别分析
levofloxacin uk order levofloxacin pill
acillin brand erythromycin 250mg us order erythromycin 500mg for sale
generic sildenafil sildenafil for men estradiol online order
buy tadalis 20mg sale order voltaren 50mg brand diclofenac
buy generic indomethacin buy cefixime 100mg generic cheap trimox 500mg
buy anastrozole 1 mg online cheap Viagra original pfizer order viagra us
cialis ohne rezept sildenafil 100mg generika rezeptfrei kaufen viagra 100mg fГјr frauen
purchase provigil online cheap modafinil 200mg canada buy acetazolamide pill
ramipril medication order generic azelastine order astelin 10 ml sprayer
order buspirone 5mg pill amiodarone pills order ditropan for sale
olmesartan 20mg brand acetazolamide cost order diamox for sale
tacrolimus 1mg uk order ropinirole 2mg online cheap purchase ursodiol online cheap
imdur 20mg brand azathioprine sale purchase micardis online
buy cialis generic order prozac generic purchase viagra online cheap
buy naltrexone pill order abilify without prescription buy abilify 30mg online
buy medroxyprogesterone generic biltricide over the counter cyproheptadine 4mg sale
order isotretinoin 40mg pills order isotretinoin 10mg prednisone 5mg cheap
cheap piracetam 800 mg sildenafil 100mg canada order viagra 100mg pills
buy zithromax 250mg for sale buy zithromax 500mg pill order gabapentin 800mg generic
cialis coupon cvs order cialis 20mg pills viagra 50mg
glycomet price brand metformin cialis next day delivery
olanzapine 10mg brand purchase zyprexa for sale valsartan 80mg generic
order clozaril 100mg online order clozaril 50mg pill decadron online
buy essay paper free slot play jackpot party casino
levitra for sale online order lyrica 150mg generic methylprednisolone 16 mg without a doctor prescription
clomiphene drug brand clomiphene play online blackjack
buy generic tadalafil 5mg buy tadalafil 5mg pills buy sildenafil generic
order triamcinolone 10mg pills claritin 10mg price desloratadine order
buy dapoxetine 60mg generic cheap levothyroxine tablets synthroid cost
buy cozaar 25mg without prescription order generic esomeprazole 40mg order topiramate pills
order colchicine 0.5mg pills free spins no deposit gambling site
buy zantac generic order celecoxib 100mg order celebrex 200mg generic
tamsulosin price buy spironolactone 25mg aldactone over the counter
simvastatin 20mg canada order valtrex 1000mg sale finasteride 5mg us
tadalafil 10mg drug tadalafil 20mg price purchase viagra online
buy sildenafil 100mg without prescription tadalafil 40mg oral cialis 5mg
order ceftin pills buy generic robaxin order methocarbamol 500mg generic
best online gambling sites order stromectol 3mg online cheap order provigil for sale
order prednisone 10mg pills order mebendazole 100mg without prescription vermox 100mg uk