How can I do in php to detect the id of a user in a link for example:
facebook.com/092439542392435555
and return on the page the details about that account
How can I do in php to detect the id of a user in a link for example:
facebook.com/092439542392435555
and return on the page the details about that account
If you are not using routing in php, I would reccomend you use “get” requests in the url. For example, instead of:
example.com/id/283493248923489234
You would want to use:
example.com/id?id=283493248923489234
To “capture” the value of id in php, you would want to use the $_GET
variable. If you have a page called id.php
and it contains this code:
<?php
echo $_GET["id"];
Somebody who visits /id.php?id=123 would see 123
on their screen.
Just note that this assumes you are using the Apache web server; this will not work if you are not using the lamp-poc project on glitch.