How to convert php-mysql-driven site to static and linked html pages? I think it will make my site faster and reduce mySQL queries. Is there an existing easy2use tool or script can do that job? thanx!

    I think any site-downloader will help you. Teleport Pro or something. I never use 'em so I don't know the names.

      Hi,the_Igel. I think it's a smart way to do.

      thefury, I'll check that link later, thanks!

        2 months later

        But what if the goal is not to fasten up your site, but you still want to convert php2html?

        I know JPCache will work (JP go!!!!! a new util-package???), but I need to get some php pages on a server which only servers html..

          then why are you using PHP in the first place?

          anyway, you need to execute the PHP somehow to get the output.

          So, you could download something to get the output, and then use it.

          For example, there's a package on sourceforge.com called FoxServ that will quickly install apache, php, and mysql with some other stuff, too.
          You can use taht to generate the HTML and then use the HTML.

          Of course, that's a lot of overhead.

          I think you can get the PHP binary alone, and use that to execute it, however I really don't know... (like a php compiler)

          if you can, why don't you use another language to generate the HTML? (port your PHP to C++ or something).

            for example,

            I build a php-mysql site on my local pc , but the free webspace supports HTML only. I want to update my site locally and only upload html . How to generate that html files?

              dude, then you need to seriously consider moving your busted ass site to a place where it will shine, cuz php is the way. do not ph34r the phorse, use the phorse, let it guide you.
              i'd seriously consider moving it to a php friendly place, hell theres even tons of servers that have mysql databases, and its all free, like www.coolfreepages.com
              php, mysql, and unlimited bandwidth.
              buuutttt if you insist, then you can use your php.exe to generate the code and export it directly to a html file.
              like so..
              php somephpfile.php > somehtmlfile.html

              and the dogs name was BINGO!
              but seriously, move to a new place, cuz html only Sucks the big fat baloney pie, and who wants baloney pie??? ewww...
              -=Levi=-

                I know I can get free php servers all over the world, but from my programmers view I want a solution for this problem..

                I need something like: http://www.silenter.com

                The page will convert all weblinks on a page to http://www.silenter.com/cgi-bin/nph-go2.cgi/11111/687474702f7777772e746f6e79626c61636b2e6f72672f6d70332f526f79616c5f46616d5f49495f5f3336335f686561762e6d7033

                for example....

                so php test.php > test.html will not work...

                I want a tool which browses a certain area and convert all pages to html and save it in a directory.. 🙂

                  I'm not sure if there is a simple way to do what you are asking. You might have to create a template file and create the html files manually, the hard way.

                  A couple months ago I was looking for something like what you are looking for, and I just ended up doing a template design and preg_replace()ing the html w/ outputted PHP values into an html file.

                    hmmm...
                    ahhh, i see what you want. well you can download a specified page:

                    
                    $file = new GetWebObject("de.php.net", 80, "/");
                    $data = $file->get_header();
                    
                    echo $data["status"];
                    echo $data["Content-Type"];
                    
                    echo $file->get_content();
                    
                    class GetWebObject
                    {
                    var $host = "";
                    var $port = "";
                    var $path = "";
                    var $header = array();
                    var $content = "";
                    
                    function GetWebObject($host, $port, $path)
                    {
                    $this->host = $host;
                    $this->port = $port;
                    $this->path = $path;
                    $this->fetch();
                    }
                    
                    function fetch()
                    {
                    $fp = fsockopen ($this->host, $this->port);
                    
                    if(!$fp)
                    { die("Could not connect to host.");}
                    
                    $header_done=false;
                    
                    $request = "GET ".$this->path." HTTP/1.0\r\n";
                    $request .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)\r\n";
                    $request .= "Host: ".$this->host."\r\n";
                    $request .= "Connection: Close\r\n\r\n";
                    $return = '';
                    
                    fputs ($fp, $request);
                    
                    $line = fgets ($fp, 128);
                    $this->header["status"] = $line;
                    
                    while (!feof($fp))
                    {
                    if($header_done)
                    { 
                    $line = fread ( $fp, 1024 );
                    $this->content .= $line;
                    }
                    else
                    {
                    $line = fgets ($fp, 128);
                    if($line == "\r\n")
                    { $header_done=true;}
                    else
                    {
                    $data = explode(": ",$line);
                    $this->header[$data[0]] = $data[1];
                    }
                    }
                    }
                    
                    fclose ($fp);
                    }
                    
                    
                    function get_header()
                    { return($this->header);}
                    
                    function get_content()
                    { return($this->content);}
                    }
                    
                    

                    maybe that will work for you.

                      Write a Reply...