[英]passing parameters by GET php
I am writing a web app and at some point, I have a list of projects and when the user clicks on view on one of the projects I need to display the correct project page, basing on the project ID.我正在编写一个 Web 应用程序,在某些时候,我有一个项目列表,当用户单击其中一个项目的视图时,我需要根据项目 ID 显示正确的项目页面。 (All the projects are stored in a Database).
(所有项目都存储在一个数据库中)。 I am trying to pass the project id by a URL query string that should look like this
我正在尝试通过 URL 查询字符串传递项目 ID,该字符串应如下所示
user/project/view&proj_id=2
then in my index.php, I try to var dump the $_GET
but it says is an empty array while if I try to var dump the URI I get user/project/view&proj_id=2
然后在我的 index.php 中,我尝试 var dump
$_GET
但它说是一个空数组,而如果我尝试 var dump URI 我得到user/project/view&proj_id=2
ho can I correctly pass and retrieve parameters with $_GET
?我可以使用
$_GET
正确传递和检索参数吗?
Use ?
使用
?
instead: user/project/view?proj_id=2
相反:
user/project/view?proj_id=2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.