I use post method to login the user, and after the user successfully login, they will be redirect to index.php. The problem is that every user gets the same home page url, instead, I want to have somthing like index.php/u=daniel so every one can have their own unique url
1 Answer
The instruction for doing what you want can be found here: php redirect with HTTP query string variables
However, I doubt it will be useful to have the username in the url. Like Marc said, you should just store the username in the session.
1 Comment
user3727724
I do store the username in the session, now, I have my url like profile.php for every user profile page, which makes no sense, and what I want is just to figure out a way to rewrite the url and change it into somthing like profile.php/u=username
$_SESSIONvariable in index.php to tell if the user is logged in, and if this is the case alter the page? Even if that username was available during the login process, it doesn't make sense to have it as a get variable in your url.