1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    Is there a way to create many pages dynamically... say using a template? I've over 110 html pages with the same format and I'm sick and tired of creating new pages, updating old ones, with content and links. I've access to linux and unix, php, perl, and java...
    Any suggestions?
  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    Well, perl and php3 are ideally suited to your task, but it depends on how far/fast/advanced you want to go. You can use a database to generate your pages, flat-file or SQL. I've successfully used dbMan - gossamer-threads.com/scripts/dbman by Gossamer Threads to create quite a large catalogue of products, which is basically what you're looking for, using flat-file databases (a MySQL version is available aswell, although it's quite expensive) and a program that's pretty easy to work with when you get the hang of it.

    And you can do the exact same thing with php3, and probably better, because php3 integrates very well with SQL databases. It takes some time, but it's worth it.

    There are a few drawbacks though, which can be got around, but take time and experience to get the hang of. For a start, if you use the one template for all of your pages, they're not going to be indexable by the search engines, because there'll be a query string on the href tag, like this:


    But you can get around that with webserver trickery, for example using the mod_rewrite module, which means you can rewrite anything under, for example, /articles to be dealt with by the one page/app. I've done this with Perl, not with php3, but I know it's possible with both.

    From experience, I would suggest you start with Perl and dbMan, and work with that first to give you experience with dealing with databases. Then start working with php3 and MySQL and get the hang of that, and then figure out the mod_rewrite mappings when you're done, and you'll just have to modify the resultant scripts a little to get that to work.

    Of course, if you're comfortable with Perl or PHP3, you can just skip all of that and start at the end!

    It may seem like a lot of work now, but the experience is invaluable if you work on the web a lot. I've just started working with MySQL and php3, after a lot of playing with Perl. This is my second time approaching it, and I can tell you now, it beats the hell out of anything else, and makes it weasy-peasy to automate nearly everything on a site. Sod ASP and microflot, this is the way to go.

    When Zend comes out, I'll probably turn into a total net freak!


    [This message has been edited by dahamsta (edited 07-17-99).]
  4. #3
  5. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    Notwithstanding Dahamsta's reply, I have a simpler, although not as robust and more basic, answer.
    I have implemented smaller sites (<1000 pages) simply using SSI and 4 templates (along with content).

    All you need is ...

    1. A format to stick with. I have used .txt as an extension for content pages, a standard header, sidebar and footer.

    2. A script that reads the directory and generates a .shtml file with the necessary html tags for each .txt file, using a VIRTUAL INCLUDE pointing the .txt file. Stick the header, side bar, content and footer into a table. I usually make the sidebar the links bar. The sidebar gets generated from a META TAG from the content pages that you want links to.

    3. Run the script.

  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Utrecht, Netherlands
    Rep Power
    i want to use a template as well:

    only with asp instead of php3

    i can't seem to find a way to assess includes containing script dynamically, with either asp or playn (d)HTML...

    can you help me?
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Rep Power
    Hi James,

    I know this is a long shot since you posted to this question awhile ago,
    but could you let me know how exactly you use the META TAGs? I was
    thinking you defined your own meta tag with a bunch of links in it
    related to the "content.txt" page and then did a virtual include on
    those through your script.

    I need to publish a load of text documents and was hoping to do it with PHP. I know Project Midgard (http://www.midgard-project.org/) is probably too complicated for me, and I only use PHP for Virtual Includes and because a friend wrote some really cool navigational tools in PHP.

    BTW, supposing your "content.txt" file contains "&" symbols for example,
    what do you use to parse the .txt file to change "&" to "&amp;"?

    Would you consider e-mailing me a copy of your php script?



Similar Threads

  1. How to create many pages dynamically from a template?
    By dchapman in forum PHP Development
    Replies: 2
    Last Post: December 27th, 2003, 04:10 AM
  2. dynamically creating array of pointers to linked lists
    By balzack in forum C Programming
    Replies: 2
    Last Post: December 1st, 2003, 11:13 PM
  3. Dynamically creating JButtons
    By hendern in forum Java Help
    Replies: 1
    Last Post: November 19th, 2003, 07:24 PM
  4. Creating new pages dymancally
    By bensin in forum PHP Development
    Replies: 3
    Last Post: June 12th, 2002, 02:54 AM
  5. how to dynamically create follow on pages
    By chrisdice4 in forum HTML Programming
    Replies: 1
    Last Post: October 23rd, 2000, 12:11 PM

IMN logo majestic logo threadwatch logo seochat tools logo