TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-01-2008, 04:37 PM   #1 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default setting a users name in the url

in websites such as myspace.com when you create a user login your profile is myspace.com/your_user_name

how do they do that? (is that a auto created folder or?)

thanks
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 10-01-2008, 05:13 PM   #2 (permalink)
The Contributor
 
jcorradino's Avatar
 
Join Date: Sep 2008
Posts: 36
Thanks: 2
jcorradino is on a distinguished road
Default

well, you can do it a clean way or a messy way

The messy way:

just use GET to call user.php?user=username

the clean way, do the above step, and mess with the .htaccess using RewriteRule to make it get rid of the "user.php?username=". you can do this by creating a .htaccess file and throwing this in there:

RewriteEngine on
Options +FollowSymLinks
RewriteRule user/(.*)/ user.php?username=$1

if you would like to see this working, take a look at my test page I put up to make sure the rewrite rule worked correctly. You can edit the name by changing the address bar.

Hope this helps
__________________
Jason Corradino
Applications Developer, Interactive Support - Tribune Technology
J2EE Development, Script Tinkering - Develop, Support, and Maintain Tribune websites.

Last edited by jcorradino : 10-01-2008 at 06:44 PM.
jcorradino is offline  
Reply With Quote
The Following User Says Thank You to jcorradino For This Useful Post:
sarmenhb (10-03-2008)
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:12 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design