您的位置 首页 php

PHP学习第十八课:POST与GET,原来这样使用

感谢关注PHP学习坊,文章内容由PHP学习坊收集整理,如有错误或者疏漏之处,欢迎在评论区指出,也欢迎大家积极评论转发。小编需要来自你们订阅、评论的支持,吐槽也好,支持也罢,欢迎大家积极评论。

表单的作用是采集客户端提交的数据,并把数据提交给服务端。

比如在登录一个网站时,你需要输入自己的用户名和密码才能登陆。

表单的两个标签必须是成对出现的:<form></form>。

form标签有两个必填的属性 : action,method。

action的作用是指定要提交到服务器的地址,比如我要提交到本站的info.php文件,那么就写成<form action=”info.php“>

method属性,顾名思义就是提交数据的方法,它有两个值可选:post/get ,post是隐藏传递,get是地址栏传递。

如果用get传递,以上就可以写成:<form action=”info.php“ method=”get”>

也可以多行文本textarea等:

<textarea name=”content”></textarea>

最后加一个提交按钮和一个重置按钮:

<input type=”submit” value=”提交”/>

<input type=”reset” value=”重置”/>

以上的几个标签除了提交、重置和form表单外,我都有些name属性,因为服务端是通过标签的name属性来获取它的值的。

PHP有四个不同的数组变量用来处理用户的输入。

HTTP_GET_VARS数组用来处理GET方式提交的变量,

HTTP_POST_VARS数组用于处理POST方式提交的变量,

HTTP_ cookie _VARS数组用于处理作为cookie头提交的变量,

而对于HTTP_POST_FILES数组(比较新的PHP才提供),则完全是用户用来提交变量的一种可选方式。

有三种方式:$_GET,$_POST,$_REQUEST。

$_GET只能获取get方法提交的数据,$_POST方法只能获取post方法提交的数据,而$_REQUEST能同时获取get和post方法提交的数据。

比如要得到用户输入的用户名和密码的值,就是 $_GET[“username”] 和$_GET[“password”],或者$_REQUEST[“username”] 和$_REQUEST[“password”]。

以上是简单的表单数据的接收。

文章来源:智云一二三科技

文章标题:PHP学习第十八课:POST与GET,原来这样使用

文章地址:https://www.zhihuclub.com/76650.shtml

关于作者: 智云科技

热门文章

评论已关闭

38条评论

  1. ipertensione polmonare e insufficienza malattie cardiovascolari; ipertensione trombotica polmonare

  2. Before you purchase the drugs, why not read over some of the reviews previous buyers have left about the Cialis available through our Cialis fastest shipping online pharmacy

  3. It is important to note that tadalafil is not enough to cause an erection by itself Reverse Cowboy This position is like cowboy only instead of Partner B facing the partner, they re turned to face their feet

  4. Zhou Zhou didn t talk so much, and said bluntly We just don t know what to say, how sad the little uncle should be when he sees this letter 95 C5 Banjo Capo handy for certain guitar partial capo positions

  5. In the present subanalysis of a larger previously published randomized controlled trial , the effect of clomiphene citrate on several ultrasonographic markers of uterine receptivity in PCOS patients who ovulated under treatment was studied.

  6. Cavadini C, Hertel C, Hammes WP 1996 Stable expression of the lysostaphin gene meat lactobacilli by introducing deletions within the prosequence.

  7. The therapeutic effect is observed after 7 12 days, during the same time the effect persists after discontinuation of the drug

  8. The other stains also rule out malignant PEComa negative smooth muscle and melanocytic markers and high grade endometrial stromal sarcoma negative BCOR and cyclin D1 APD you are definitely not going crazy

  9. septra buy bactrim baikal pharmacy Under the deal, Ally also will pay the government accrued dividends plus 725 million for the Treasury Department to give up rights to convert the preferred stock to common shares Also, because flaxseed is high in fiber, it can reduce the risk of heart disease and stroke

  10. However, no clinical trials have been done to determine whether increasing vitamin D intake or sunlight exposure would prevent MS

  11. com 20 E2 AD 90 20Viagra 20Apotheke 20Rezeptpflichtig 20 20Precio 20Viagra 20Andorra 20Sin 20Receta precio viagra andorra sin receta If Mr Gates isn t going to do it, it now falls to him Гў as the most important member of Microsoft s board Гў to find the second best person to head the company in the wake of Mr Ballmer s announcement that he ll be stepping down as CEO When amygdalin interacts with the enzyme beta glucosidase or undergoes hydrolysis in the absence of enzymes, hydrogen cyanide, benzaldehyde, and glucose are produced

  12. naprelan antibiotikum ciprofloxacin milch L Oreal, meanwhile, has seen margins improve thanks to thelaunch of new and more expensive items and recently boughtChinese facial mask provider Magic Holdings, in a bid to expandin the fastest growing sector of China s 15 billion skincaremarket Scalp biopsies were directly embedded in optimal cutting temperature OCT compound for frozen sections, or fixed 24 48 h with neutral buffered 4 paraformaldehyde PFA and directly paraffin embedded

  13. The adverse effects of adjuvant therapies on cognitive functioning including verbal memory immediate and delayed recall, visuo spatial memory, executive functioning, attention concentration, psychomotor speed, verbal fluency, verbal articulation language skills may exert profound effects on quality of life QOL 6 8

  14. Issues of safety are under constant review, but justified concerns about high doses of tamoxifen acting as a promoter of liver cancer in rats or as a promoter of endometrial cancer in women have not, as yet, proved to be of clinical relevance

  15. Cancer Genet Cytogenet 158 55 60 For some patients, no more spare BM was available for the present analysis

  16. The results are consistent with prior studies, which have also shown little health benefits of multivitamins, the most commonly used vitamin supplement

  17. RNA isolated from resected tumors at treatment end day 28 was used for DNA microarray experiments, as described in Methods We also review how clinic approved and experimental therapies as well lifestyle approaches may promote aortic root stability by correcting NO homeostasis, which if properly optimized may improve outcomes in this population afflicted by a notoriously refractory type of aortopathy

  18. acivir allegra vs claritin Finally, the authors factored in a lower mortality associated with estrogen avoidance for women with and without ovaries

  19. However, good agreement regarding ER and PR status between these methods has been reported, and the pooling of the data would therefore have only a minor influence on the results

  20. For more information, see NWHN s Fact Sheets on Addyi Health Fact Sheet and Sex Drugs for Women

  21. A deep voice sounded, and in the cave of Tianhuang Mountain, a figure gradually walked out 73USD tab Symax SL 0

  22. spiedigitallibrary Rogge looked at Feng Die in the corner, and suddenly his whole body shook and froze there

  23. However, if there are spectators who can sign language and see the sign language dance can I lower my blood pressure fast and mute actors on the stage, they will know that the content of their sign language at this time best way to naturally lower blood pressure the lyrics of the song Joan Coby sang behind the scenes

  24. Keywords Androgen receptor; Breast cancer; Endocrine therapy resistance; Epidermal growth factor receptor; Estrogen receptor; Tamoxifen 11 In contrast, women with non luminal A ER positive tumors appear to derive significant benefit from the use of adjuvant chemotherapy, and may receive less benefit from the use of adjuvant hormonal therapy

  25. The oncologist said there was a 70 recurrence rate and that because it s estrogen positive breast cancer the pregnancy will feed it to grow She doesn t agree with my medical oncologist about only 3 years on Prolia which I finished in April

  26. We always recommend our customers to take Nolvadex in order to prevent or stop unwanted symptoms during cycle 289 Settlements Reached in Toyota Unintended Acceleration MDL

  27. What is the significance of the timing The determination of the power of the correcting cylinder is carried out by placing the cross- cylinder lens with one of its axes parallel to the axis of the correcting cylinder

  28. White line marks the border of isolated cluster domains based on the top 10 of the highest kernel density

  29. One of the possible side effects associated with use of Nolvaxyl is the possible reduction of insulin like growth factor levels

网站地图