SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: Help Required

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help Required

    Scenario.

    If I have an admin section in which a user can add pages and content dynamically (the private part of the site) - pages and contents stored in a database.

    What is the best way to create these pages on the public side of the site after querying the database. For example:

    PHP Code:
    $fp fopen("How to create pages on the fly!.php""w");
    fwrite($fp"Some content in your file");
    fclose($fp); 
    Would I use something like the above?

    What are my alternatives?

  2. #2
    Wadge! F4nat1c's Avatar
    Join Date
    Oct 2005
    Location
    South Wales, UK
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't really understand what you mean?
    OMFG SitePoint ROXORZ TEH BIG ONE111!
    Wish you were invisible?

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    My website has 2 parts, a public part and a private part. The private part lets the user add a page and define its properties e.g.

    - Page Title;
    - File Name;
    - Directory/Sub Directory;

    It also lets a user add content to this page via a WYSIWYG editor (pictures and text).

    All this information is stored in a database.

    The public part will need to retrieve this information and build the pages that have been dynamically created?

  4. #4
    SitePoint Enthusiast lix0r's Avatar
    Join Date
    Feb 2006
    Location
    Norway
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm.. isn't it easier to just have a php file, lets say page.php, to display the content from the database?

  5. #5
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Plano
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the code example you showed is getting information from a text file. you mentioned twice that the information is stored in a database. this may be what is confusing people.

  6. #6
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not if I need to create the pages dynamically!

    For example, if a user wants to manage pages on a site without the need for a web developer - he/she will want to publish and remove pages as required.

    Say a company has a new service but it only runs for 6 months. A new page about this service will need to be added then remove after this period expires.

  7. #7
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, the code above creates a .php file and content can be added after querying the database.

  8. #8
    SitePoint Enthusiast lix0r's Avatar
    Join Date
    Feb 2006
    Location
    Norway
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about adding a expiration date to the content in the database? When this date is reached, only the backend users of the site can access this site/content

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •