converting a php script to static executeable html file

by 7 replies
8
I am currently working on a dynamic webpage, is it possible to generate html-files from this php-script that will load as the original php-script.
#programming #converting #executeable #file #html #php #script #static
  • You could save the output of the .php Script and upload this file to the webserver.

    You can't directly convert PHP into HTML.

    Let me explain this: PHP is executed like a program on the webserver. It can read out entries from the database, even generate random numbers...

    A HTML file is static and can not change anymore.

    Is that really what you want?
    • [1] reply
    • The reason i am asking, is that i want ot code a standard site template, but load it with different content, thus the php-script needed. The reason for HTML is that i want to sell these sites, without given awat my template...hope is makes sense
      • [1] reply
  • You would have to write another script (PHP) to save the output as an .html file.

    Similar to a cacheing systems in forums, CMS's etc....
  • Use a web site crawler to save your site in HTML format.
  • I've done something like this for a website that does 3million unique's a month (it's a real estate portal!).

    Best way to do it (in a very simple high level overview)

    1) load ob_start() function
    2) generate output
    3) use ob_get_contents() function to get the generated html
    4) save the contents of ob_get_contents() to a static file (ie subject-story-1.html)

    If you do this in a systematic way, you'll be able to generate entire static sites on the fly.
    • [1] reply

Next Topics on Trending Feed