I am new to PHP.
I have a page that displays user profile. I need to pass user id to this page
so that correct profile was displayed.
I just dont use the <form> element. I want to have a link
<a href="/users/24378234298734"> or <a href="/users/?id=24378234298734">
or whatever
Since I am not using form I cannot use _GET or _POST on the handler page
What is the best way to handle the parameters on handler page?
A form with
method="GET"is just a way to build a query string automatically based on user input. Nothing prevents you using$_GETto read data from a manually constructed query string (and the server can’t tell the difference anyway).<a href="/users/?id=24378234298734">will cause$_GET['id']to be populated.