【发布时间】:2013-02-19 09:43:53
【问题描述】:
点击位置 user_id 1 的用户 John Smith 它应该转到 URL www.example.com/John-Smith 而不是 profile.php?uid=1
当您点击 user_id 2 中的用户 John Smith 时,它应该转到网址 www.example.com/John-Smith-2 profile.php?uid=2
当您在 user_id 3 中单击用户 Kia Dull 时,它应该转到网址 www.example.com/Kia-Dull profile.php?uid=3
Table Users
User_id First_name last_name
1 John Smith
2 John Smith
3 Kia Dull
如何为此格式化我的 .Htaccess 文件和 php/sql。
当点击用户个人资料时,我只是简单地将其引导到此处。
<a href="<?php echo $row[first_name] ?>-<?php echo $row[last_name] ?>"
什么都不做。
这是我的 .htaccess
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)$ profile.php?uid=$1 [L]
【问题讨论】: