autogenerating html

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tusk
    New Member
    • Aug 2006
    • 1

    autogenerating html

    Hello People - :)

    I have an itch! and can't find a scratch! - No matter how hard I look!

    I have a PHP script that produces a calendar ...
    [ not like one you've ever seen before ] and It holds the server for a second to produce the page: Now this page COULD be made every day! -

    So here's the rub [ itch! ] can I output the PHP results to a static html file that the Brower reads - Instead of PHP chundering every time the site is viewed?

    I could use PHP to test the date of the html.file and If it was out of date autogenerate! a new one ...

    ... It seems possible, but I cannot find out how to do it!? - anyone, ANY IDEAS!? :confused:

    RGDS - Terry
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    Now your wanting to make this caldenar output to a static html file instead of it dynamicly creating the calendar every day?

    My Resolution to this is to use FSO not sure if you can do it in PHP but you can in ASP...

    try searching goodle for PHP FSO and see if you can find any examples... this should help you get started on writing to a file via PHP

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Why don't you just check (PHP) if the file is still current? And if not, generate a new one.

      Code:
      if (file_create_date != current_date)  {
         create_new_calender as existing_calender;
      }
      echo existing_calender;
      Ronald :cool:

      Comment

      • iam_clint
        Recognized Expert Top Contributor
        • Jul 2006
        • 1207

        #4
        PHP isn't going to regernerate its creation date because it doesn't recreate the file i would assume ronverdonk, You could do it similar though by writing to a database to keep track of when it was last written to the database.

        We may need to see some of the source for this "special" calendar.

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          Yes you can, iam_clint!. When you create a new file and you give it a filename that is derived from the date you created it, e.g. "calender yyyy-mm-dd.html", you can generate a new calender file each day.

          I use the same file naming convention for my PHP-generated backup files and it never failed me.

          Ronald :cool:

          Comment

          • iam_clint
            Recognized Expert Top Contributor
            • Jul 2006
            • 1207

            #6
            Sorry i misread his question i suppose i thought it was generating a dynamicly created calendar on the same php page and displaying it, i thought his question was how to create a static html file based on this, so my mistake ronald if you get what i was trying to say a dymanicly created php page pulling data from somewhere else based on variables and such its date wouldn't change.... but if i am reading the question the right way this time your solution would work fine.

            Comment

            Working...