URL Manipulation like this is not done through PHP code.
It is done using the Mod Rewrite apache module using an .htaccess file.
there are many resources through google that talk about the mod rewrite module, here is one that i found through a quick google search:
guide-url-rewriting/
In reality, though, you shouldn't be using a URL variable to pass the users ID.
When the user logs in, the ID is stored in a session variable, you should be using the session for filtering the recordset. Using a url variable means that ashley could log in, then change the URL variable to johns id