#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    38
    Rep Power
    10

    Generating static html pages


    Hello guys,

    I need some help with a project a client wants. He wants a catalogue of products - in effect a "mother" webpage that lists all types of products available and "child" webpages that are static html pages and which will give the details of each product. He wants that the "mother" have a form to add product details and that these details be translated into a static html page when submitted. If I code the "mother" in php, is there a tool available to automatically create static html pages on the fly like this?

    I hope I have made my issue clear.

    Thanks,

    Leo
  2. #2
  3. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    ...why? is his/her server load so high that static content is required?

    Anyway, Phunami will spider your site and generate static pages, otherwise add something to the upload/edit form that creates a static page ( shouldn't be too hard - I'd wget/curl the non-static page, and save the html in the static location ).

    What language do you want to implement this in & I'll move this thread there.

    --Simon
  4. #3
  5. fork while true;
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2005
    Location
    England, UK
    Posts
    5,538
    Rep Power
    1051
    well, in php it's fairly easy

    capture the output you would normally print to screen like so

    ob_start();

    //echo some crap here

    $data = ob_get_contents();
    ob_end_clean();

    then print $data into a static file.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    38
    Rep Power
    10
    Thank you for your help.

    I intend to do this in php. Had started in that forum, then thought that this would be a better place to get answers should the solution be a non-php one.

    Leo
  8. #5
  9. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    Ok, I'll move it in there ( although, yes this could be done in any language, but if php's the one you're familiar with, you should go with it). You might want to post some specifics of what you're trying to do etc.

    --Simon
    Last edited by SimonGreenhill; February 9th, 2006 at 08:03 PM.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    38
    Rep Power
    10
    Thank you.

    Like I said, what I primarily want to do is submit a form and then be able to generate a static html based on the information I have submitted.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2002
    Posts
    596
    Rep Power
    23
    Originally Posted by leonardjensan
    Hello guys,

    I need some help with a project a client wants. He wants a catalogue of products - in effect a "mother" webpage that lists all types of products available and "child" webpages that are static html pages and which will give the details of each product. He wants that the "mother" have a form to add product details and that these details be translated into a static html page when submitted. If I code the "mother" in php, is there a tool available to automatically create static html pages on the fly like this?

    I hope I have made my issue clear.

    Thanks,

    Leo
    why does your client care whether static html pages are used - what's it to them? The form could just as easily add a record to the database and you would have fewer problems with editing/maintaining the data. They don't need to give you the spec to this level of detail, since it adds no value to him and has no effect on the user experience. Write your php files with a html extension, tell your webserver to parse them as php and charge him extra for the technical genius involved with created static pages on the fly ;-)
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2006
    Posts
    2
    Rep Power
    0
    If I understand you correctly, your client wants to be able to enter a description, graphics, etc. into a browser-based "form" and generate a page from it that can then be delivered from a website/intranet/catalogue whatever.

    The problem, as I see it, is not one of generation ... PHP/ASP/VBscript/Javascript/whatever will generate html 'on the fly' with ease (that's the point) ... but one of output - How does the client save the page generated to a drive somewhere (local HDD, folder on a webserver, wherever) without having to do so by hand?

    Along with everyone else, I have to wonder at the motivation behind this - If your client wants dynamic generation of web-pages, why on Earth don't they deliver dynamic pages in the first place?

IMN logo majestic logo threadwatch logo seochat tools logo