Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
url format for users domain.com/user
Old 03-01-2009, 11:22 PM url format for users domain.com/user
Extreme Talker

Posts: 176
Trades: 0
1.
I'm creating a website, where a user signs up, and they get a homepage.

Right now, the format is
domain.com\homepage.php?user=username
but some sites have things like
domain.com\username

I was just wondering how this is done. I'd guess that a new folder is created for each user, am I correct, or can this be done through some code.

Are there any advantages / disadvantages to creating folders for everyone?
Aside from the files taking space, which wouldn't be much because I could just include the php code from elsewhere.

2.
Also, I'm allowing users to do their own CSS code, should I store it in a database, or create an external file for each one. I just thought there might be some security flaws in storing it in the database(some sort of injection).
Skeddles is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-02-2009, 04:45 AM Re: url format for users domain.com/user
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You don't actually create folders, you merely give the impression of folders using some .htaccess rewrite trickery, providing you are hosted on Apache of course.

For CSS code I tend to go with a real physical file, nothing to do with security though, more to do with speed and browser caching.

Stylesheets stored in a database have to be either included in the page or created "on the fly" at each page access. By creating them each time they are always "new" so will be "re-cached" each time.
However, having said that, if the users only have the one page, an in-page stylesheet isn't really going to be much of an issue.

And because you write the CSS into the page the security issue is minimal, just make sure you "break" anything that looks like it could be javascript.
Replacing "<" & ">" with nothing or the equivalent HTML entity will be enough.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-03-2009, 04:07 PM Re: url format for users domain.com/user
Extreme Talker

Posts: 176
Trades: 0
Quote:
Originally Posted by chrishirst View Post
You don't actually create folders, you merely give the impression of folders using some .htaccess rewrite trickery, providing you are hosted on Apache of course.

For CSS code I tend to go with a real physical file, nothing to do with security though, more to do with speed and browser caching.

Stylesheets stored in a database have to be either included in the page or created "on the fly" at each page access. By creating them each time they are always "new" so will be "re-cached" each time.
However, having said that, if the users only have the one page, an in-page stylesheet isn't really going to be much of an issue.

And because you write the CSS into the page the security issue is minimal, just make sure you "break" anything that looks like it could be javascript.
Replacing "<" & ">" with nothing or the equivalent HTML entity will be enough.
Cool, do you know any good tutorials for .htaccess? I can't find any and I can't get it to do what I want
(type domain.com/register but show domain.com/register.php)
Skeddles is offline
Reply With Quote
View Public Profile
 
Old 03-03-2009, 05:48 PM Re: url format for users domain.com/user
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Not a tutorial as such, but -> http://www.highrankings.com/forum/in...p?showforum=61 has probably got more examples of .htaccess rewrites than most places.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to url format for users domain.com/user
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.87042 seconds with 12 queries