0

Possible Duplicate:
Custom URL for each user in PHP

I'm starting a new project building an online community. I would like to use a profile similar to Facebook in the way that each user has a unique url (ie http://www.facebook.com/username). I am familiar with using the $_GET function to get an ID from the URL but would much rather make the URLs short and memorable. As of today I noticed Facebook uses both /username and profile.php?id=1234 methods. Can anyone explain to me how this works? Thanks.

4

1 回答 1

0

对于这种规模的项目,它将涉及身份验证、收集用户输入以及许多其他程序员已经完成并经过安全测试的其他任务。您应该考虑使用 PHP 框架,例如 CodeIgniter、Symphony 或 CakePHP。从长远来看,这将使您的生活轻松 10000000 倍。

至于您的问题,在您的 .htaccess 文件中使用 mod_rewrite 可以使 url 看起来不错。

于 2012-07-15T01:26:49.777 回答