Page 1 of 1

dynamic link creation

Posted: Mon Jan 17, 2011 6:02 pm
by sshaham1
How do websites like facebook and formspring dynamically make subdirectory links for their new users?

for example, if i sign up on formspring and my username is USA1992, the link to my profile is formspring.me/USA1992

how do websites do that?

Re: dynamic link creation

Posted: Mon Jan 17, 2011 6:35 pm
by Jonah Bron
You need to use url rewriting to map (for example) "http://example.com/bob123" to "http://example.com/user.php?user=bob123". Then you can use $_GET['user'] in user.php to bring up that user's profile.

http://www.google.com/search?q=php+url+ ... g+tutorial

Re: dynamic link creation

Posted: Tue Jan 18, 2011 3:02 am
by Peter Kelly
Use Mod_Rewrite have a look at http://www.easymodrewrite.com for guidance