Saturday, 15 January 2011

PHP - User Profile URL From Ugly URL -


OK, I usually try to remove things on my own, but I'm stumbling. I am currently making a PHP registration / login / profile system with PHP and SQL. I'm 97% complete, but I need some help with a user's profile.

I currently have a form where you can search for users. This is a GET form that links to "www.example.com/profiles.php?username=" I would like it to be able to link it to something like "www.example.com/user/" or "www.example.com/profile/". I would like to use the "User /" URL to go directly.

I believe that there are rules to rewrite this, and I have made many efforts. I still have trouble working, any help? thank you in advanced.

Here's my present. The Htaccess file is (does not work):

  ^ user ([^ /] *) on the revival engine rule. Php $ /profile.php?username=$1 [L]  

If this htaccess works, then what should I add? Because at present, nothing links to "/profile.php?username=".

Then, to clarify, I want to be able to link the output to www.example from the GET form. .com / profile / USERNAME or www.example.com/user/USERNAME I would also like to use my profile by typing www.example.com/profile/USERNAME


No comments:

Post a Comment