Jump to content

Files in php


jason257

Recommended Posts

Hi there, i have to make project for my school which is to be clone of blogspot in PHP.

 

i have no clue of as to how blogspot gives unique url ("myblog.blogspot.com") to its users, does it create new files for each user using information provided or stores all data in database and then recreates user's pages when required. Please help me out,i am in desperate need of it.

 

Thanx

Link to comment
Share on other sites

Blogger creates sub-directories for each user and it calls them myblog, etc. and it's formatted in this case as myblog.blogspot.com but in some cases it could be blogspot.com/myblog but they have chosen to format it before their own domain name.

 

The input data entered by the blogger is always held in a database and fed to the page.

Link to comment
Share on other sites

Just to be absolutely clear, an address like http://myblog.blogspot.com is usually a subdomain, rather than a subdirectory. I say usually because it is possible to use mod_rewrite and other rewriting scripts to rewrite sub-domain URIs to subdirectories (although it isn't very common in my experience.)

 

And yes, the information about each blog will be held in the database. A templating system will be used and the blogger's posts and other information will be inserted at appropriate points.

 

Hope that makes sense.

Link to comment
Share on other sites

Thx alot for replies, but if blogger's posts are stored in database then why when i click any of previous posts page opened seem like it is stored as page.

 

example:- Say if i click at any of the links in the sidebar of "http://myblog.blogspot.com" the page opens with address "http://myblog.blogspot.com/title-of-post.html". shouldn't it open a standard page like "post.html" for all the links in the sidebar, afterall if all data is being inserted at being requested then css for design could also be added then and all the posts belonging to same blog should open with same address.

 

Thanx

Link to comment
Share on other sites

I'd actually go further than Ben; these days, almost every site more complex than a 6-page static html site will be using some type of framework that will allow 'pretty' URLs. (Or more properly in a technical context, URIs.)

 

For example; Joomla, Wordpress, Ruby on Rails, Django, CakePHP, Codeigniter, ASP.NET MVC - they all allow URL manipulation out of the box. Heck, you can even take a look at the URI of this page for an example! URIs these days bear almost no relation to files on a computer, as they might have done in the past.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...