5 Replies - 6284 Views - Last Post: 12 June 2012 - 10:03 AM

#1 dhaxe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-December 08

Creating a site with User-generated pages

Posted 11 June 2012 - 08:33 PM

Hi - I've been trying to develop a simple site which allows users to make lists of things (I'm teaching myself php, mysql, etc along the way). The site has user management/login/etc functionality, and I've developed a page where the lists can be created.

I just feel like the way I'm generating pages based on users is inelegant, and I'm wondering how more sophisticated developers do it. Right now a user can sign-up and that will give them an account page (e.g. www.website.com/Daniel/index.php). They can then generate lists, each of which is a new page (e.g. www.website.com/Daniel/List1.php).

I've been using php 'fopen' and 'fwrite' functions to generate a page like 'Daniel/List1.php'. I can see where this would get really difficult to do though, as I continue adding features to the site. It also generates a lot of pages, which would all have to be edited if I made a change to that page, so I assume something more modular might be possible. How would a site like facebook do this (e.g. in the early days, when it was a simpler php/sql site)?

It's been a little tricky to find an answer to this online, since I don't really know what I'm asking... would appreciate pointers in the right direction. Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Creating a site with User-generated pages

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3480
  • View blog
  • Posts: 10,033
  • Joined: 08-June 10

Re: Creating a site with User-generated pages

Posted 12 June 2012 - 03:00 AM

the question is, how free are the user in generating their pages? is it only content => CMS, can they use their own design => predefined themes to self-made CSS, or can they do everything => get them their own server account.
Was This Post Helpful? 0
  • +
  • -

#3 dhaxe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-December 08

Re: Creating a site with User-generated pages

Posted 12 June 2012 - 08:57 AM

It's content (think twitter) - a user can create an account, then start adding data (right now entirely text). The site is about making lists, but imagine if it were a twitter clone.
Was This Post Helpful? 0
  • +
  • -

#4 dhaxe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 18-December 08

Re: Creating a site with User-generated pages

Posted 12 June 2012 - 09:57 AM

I guess another way to put it, if I want to have:

site.com/daniel.php
site.com/daniel/list1.php
site.com/daniel/list2.php

Do I really need to have separate pages created on my server for each of these URLs, or can I link to site.com/daniel/list2.php and a script generate a page view on the fly (without having to make an actual page)?
Was This Post Helpful? 0
  • +
  • -

#5 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3480
  • View blog
  • Posts: 10,033
  • Joined: 08-June 10

Re: Creating a site with User-generated pages

Posted 12 June 2012 - 10:03 AM

of course you can (with a little help from mod_rewrite).
Was This Post Helpful? 0
  • +
  • -

#6 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1865
  • View blog
  • Posts: 20,278
  • Joined: 17-March 01

Re: Creating a site with User-generated pages

Posted 12 June 2012 - 10:03 AM

Think less about individual pages and more about data in a database and a single page that retrieves that data based on parameters.

For instance:

site.com/list.php?user=daniel&list=2

So you would only have 1 PHP file to display all the lists, you would just pass the user ID and list number to display then query the database with that information.
Was This Post Helpful? 3
  • +
  • -

Page 1 of 1