开发者

creating unique user web page

I want a customized home page for each user of my site. I was thinking it might be best to have a master page with place holders (for name,开发者_运维问答 default image, etc) and have the site pull the data from the db on page load. Is this better than storing the web pages for each user?

I understand it might not be as simple as I stated. I am just trying to get an idea for the direction to move to.


In general, yes. That's pretty much how every site with users' pages does it (including this one, I assume).

To be "complete", you'll have to run a cost benefit analysis: It is worth generating and storing potenially thousands of page (many of which may never be accessed), versus reading the database and regnerating the page every time someone views it.

You would also need to consider, how dynamic is the page? How often will it change? It is worth regenerating the stored pages whenever a change occurs?

For an example of a place where I chose to generate them all in adavance and store them, check out this: http://noveltheory.com/tictac/ (be sure to read the "What so special about this" link on the page)


What you stated is how it should be done. You'd use a programming language designed for dynamic web pages and pull information out of a Database and place it into an HTML document and send that off to the client to view.

The most popular language for this is PHP, but I personally dislike PHP. Some other options are Ruby on Rails and Django (Python framework).

These languages give you far more power to do things with your site than plain old HTML does. You can create unique web pages for each user without doing any additional work, and they can also allow you to put data into the database so that it can be used to construct a page. And you can do user authentication if you want to do logins and stuff like that; there's all kinds of possibilities if you use a server side programming language to build your site.


Storing pages for each user doesn't make sense. If all you need is name, default image etc. all you need to do is a simple web page that retrieve whatever it is that is per-user from the db.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜