-2

I am developing an website in which, there is registration of users, users can make there profile and lots of stuff like any social networking website.

Now i have made such a thing from scratch that when i or anyone (loggedin as user,having a profile),clicks link to profile of other(i.e friends),a link is set up to such a thing,i.e

www.Highvay.com?users.php?PID=23 (means when i open any accounts of my friend or someone else,i usually have above address in my address bar)

usually i use get variable PID in users.php and then fetch information of that account holder.

$PID=$_GET("PID");
// now do all stuff with databse

Now what i want is whenever an account opens, one should see www.Highvay.com/mukur

mukur is username

For this i tried , changing URL by HTML5's push, but it only changes the url. Means if i enter "www.Highvay.com/mukur" in address bar manually, page is redirected to elsewhere...

how to implement such a thing ...much like facebook (www.facebook.com/mukur.puri) and twitter (www.twitter.com@7mukur7)

Zafta
  • 655
  • 1
  • 10
  • 26
  • what was there in giving a negative score to this question, as you showed the duplicate one , my question was more basic.. and more understandable.. think about it!! – Zafta Jul 26 '13 at 11:49
  • You showed little research effort. This is one of the most asked questions ever. Google "Pretty URLs". Even if you understandably didn't know to google for that yourself, a little bit of poking around existing questions should have let you onto that path pretty quickly. – deceze Jul 26 '13 at 11:53

2 Answers2

0

the above ur qustion seems to u need to learn more things currently you fetch user information from user id u should create a one field named username also u need to learn few things about

  • authorization

    • URL rewriting
Anant Dabhi
  • 10,864
  • 3
  • 31
  • 49
0

Create .htaccess file

Check out this link LIink

Options +FollowSymLinks  
RewriteEngine On  

RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f  

RewriteRule ^users/(\d+)*$ ./profile.php?id=$1  
RewriteRule ^threads/(\d+)*$ ./thread.php?id=$1  

RewriteRule ^search/(.*)$ ./search.php?query=$1  
Tushar Gupta - curioustushar
  • 58,085
  • 24
  • 103
  • 107