Search code examples
phpurlget

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. (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

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

ho can I correctly pass and retrieve parameters with $_GET?


Solution

  • Use ? instead: user/project/view?proj_id=2