作者:拍友2502862603 | 来源:互联网 | 2023-05-17 10:51
Sometimeago,Iwasinainternship,andIwasworkingasajuniorweb-developer.Whileworkingand
Sometime ago, I was in a internship, and I was working as a junior web-developer. While working and learning, I noticed that when changing pages, instead of using isset($_POST/GET/REQUEST["var"])
they just used $_POST/GET/REQUEST["var"]
.
不久前,我还在实习,我是一名初级网页开发员。在工作和学习的过程中,我注意到,在更改页面时,使用的不是isset($_POST/GET/REQUEST["var"]),而是使用$_POST/GET/REQUEST["var"]。
So, later I came home, and tried the same thing. What happens ? Every-time I come across a if()
to verify that, I have to use isset()
, otherwhise it gives me an error. But notice one thing, my url is this:
所以,后来我回家,尝试了同样的事情。会发生什么呢?每次我遇到一个if()来验证它,我必须使用isset(),否则它会给我一个错误。但是注意一件事,我的网址是
?p=sub_artigo&id=2
So, when I do the if()
condition:
当我做if()条件时
if(isset($_REQUEST["p"])=="procurar" && $_REQUEST['cont']){
It doesn't show errors, but if I take of the isset()
, it gives the usual error that I see in the forums and here.
它没有显示错误,但是如果我使用isset(),它给出了我在论坛和这里看到的常见错误。
So my question is, why doesn't show the error for the second variable ?
我的问题是,为什么不显示第二个变量的误差?
Note: p->string;id->int
注意:p - >字符串;id - > int
3 个解决方案