[英]extracting text from URL with $_GET
I have a URl that looks like this: 我有一个看起来像这样的URl:
http://somedomain.com/article_view.php?articles=ViewAll http://somedomain.com/article_view.php?articles=ViewAll
I am then trying to extract when articles=ViewAll using: 然后,当我使用以下命令尝试提取当article = ViewAll时:
if(isset($_GET['articles']) && $_GET['articles']=='ViewAll'){
//do something here
}
It doesn't seem to be working as it never drops inside the if statement. 它似乎没有用,因为它永远不会掉入if语句中。 I assume my syntax is wrong but as a newbie I can't see my error. 我认为我的语法错误,但是作为一个新手,我看不到我的错误。 Your help much appreciated. 非常感谢您的帮助。
this works for me try it: 这对我有用,请尝试:
if(isset($_GET['articles']) && ($_GET['articles']=="ViewAll"))
{
}
try checking the rest of your code or paste the rest of the code here so I can see what may be wrong 尝试检查您的其余代码,或将其余的代码粘贴到此处,以便我可以查看出什么问题了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.