hay I just wanted to know how to websites like have there url more to say a members profile?
for example if a users url redecertor is www.sitename.com/pure and the users name is pure how do i make the main page pick this up and use it to move to the users profile page?
so like www.sitename.com takes you to index page like normal and www.sitename.com/pure takes you this users profile page.
URL moving?
Started by 1288, Sep 29 2006 06:28 PM
5 replies to this topic
#1
Posted 29 September 2006 - 06:28 PM
#2
Posted 29 September 2006 - 07:11 PM
I'm pretty much less than a "newbie" to PHP, but could somebody achieve this by using the GET function to get the username, then grab everything else on the profile by refereing the database results to the username?
This is a question I've often pondered about myself, it would be cool to see how wrong (most likley) or right I am about this.
Btw, you mean like, the way www.deviantart.com works?
E.G http://username.deviantart.com is the page and username is the well... username ?
- Adam
This is a question I've often pondered about myself, it would be cool to see how wrong (most likley) or right I am about this.
Btw, you mean like, the way www.deviantart.com works?
E.G http://username.deviantart.com is the page and username is the well... username ?
- Adam
#3
Posted 29 September 2006 - 10:02 PM
Yup. 
The script gets the username by the GET method ($_GET['user']), then a mod_rewrite forms this easily.
The script gets the username by the GET method ($_GET['user']), then a mod_rewrite forms this easily.
RewriteRule $(.*)/$ /member.php?user=$1 [nc]Basically just like that.
#4
Posted 30 September 2006 - 01:50 AM
Hell yeah!
I was right about something!
Even if 1288 doesn't check back on this thread, thank you Demonslay
.
- Adam
I was right about something!
Even if 1288 doesn't check back on this thread, thank you Demonslay
- Adam
#5
Posted 01 October 2006 - 08:32 PM
hay sorry i havnt replyed i have hat the net for a bit but ya i was looking at mabby getting it like www.deviantart.com but i just cant get my head around it. i can do things like ?id=1 but how can i do that exact thing but have it use the username like with deviantart.com or if i cant get that id like to atlease get the www.site.com/username
also sorry Demonslay i dont get exactly how that works
and also adam127 ill take a look at mod rewrite
soz i just didnt know it was called that
also sorry Demonslay i dont get exactly how that works
and also adam127 ill take a look at mod rewrite
#6
Posted 01 October 2006 - 09:14 PM
Demonslay is showing you how you can use mod_rewrite to change your URL's. You can set mod_rewrite up in a .htaccess file ( that's where to put his code into ), but you can't just copy / paste you really need to learn some of the basics. Check out some of these links to get a grip on mod_rewrite.
1. http://www.sitepoint...e-url-rewriting
2. http://zulumonkey.org/?id=tutorials&pa...ment&oid=75
1. http://www.sitepoint...e-url-rewriting
2. http://zulumonkey.org/?id=tutorials&pa...ment&oid=75
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
