Reputation: 262
I have a header redirect that's header("Location: http://mywebsite.com/folder/PAGEKEY");
Where PAGEKEY
is a random generated key that looks like this: z4k4IKCL
.
My questions is how can I acquire the key from the address? I need to be able to link to the URL and can't rely on information used on the previous page.
the key will be used to query a MYSQL database.
Upvotes: 1
Views: 117
Reputation: 26804
$url =$_SERVER['REQUEST_URI']
$parts = explode("/", $url);
$pagekey = $parts[2];
Upvotes: 2
Reputation: 94682
You could use $_SERVER['REQUEST_URI']
This gives you everything on the url after the http://mywebsite.com
part of the url.
Upvotes: 0