SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Not Bad, eh? Justin Sampson's Avatar
    Join Date
    Aug 2000
    Location
    N.S., Canada
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    Does anyone know where I can get or learn how to make a script to automaticaly take the contents of a page and insert it into a premade template using php? The content that I want to insert isn't in a mysql database, just a static html page.

    If you don't know what I mean I want something like sitepoint.com has for it's articles to make a printer friendly version.

    Thanks,
    Justin Samposn

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Statically? I doubt it - doesn't need to be SQL, but you'll almost surely have to use some sort of database for it.

  3. #3
    SitePoint Zealot Wilmot's Avatar
    Join Date
    Feb 2000
    Location
    Brisbane, Queensland, Australia
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since I have not been able to set up a database for my site content as of yet, I am dynamically generating the content from text files..

    I have a template for the content pages called content.asp, and have the article text in seperate files with minimal formatting html (<p>, <li>, etc.). When the user clicks on the link to the content it will look something like this: href="content.asp?articlename". In the content.asp file, it just adds ".html" (that is the extension I use for the files containing the actual text of content) to the text after the ? and loads the text from that file onto the page.

    You may consider doing something similar to this for the printer friendly version of your pages.

    While I implemented this method to keep me going until I make my site database driven, I have found it to be a major time saver when adding/editing content.
    Brad Culbert
    SQL Server 2005 Books
    www.SQLServer2005Books.com - Reader-rated SQL Server 2005 Books

  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Absolutely - that's just one rung down from a database-driven site, and I've come across many large sites that use it - it works just fine as long as you don't need too much flexibility - and 9 out of 10 of us probably don't.


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
  •