Forum Moderators: open

Message Too Old, No Replies

Is there any sofware out there that easily converts PHP sites to HTML?

Is there any sofware out there that easily converts PHP sites to HTML?

         

infusion

6:15 pm on Dec 13, 2003 (gmt 0)

10+ Year Member



I have 250 pages I need to make into HTML. Ugh! It is taking 4-ever! Thanks in advance!

mipapage

6:16 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld! [webmasterworld.com]
I think people link to that page when they welcome...

I believe that you can write a little PHP script that will do this for you... Check around, I will too and post back here...

[edited by: mipapage at 6:18 pm (utc) on Dec. 13, 2003]

DrDoc

6:17 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmater World!

Why not just open the pages in your browser and save the output?

infusion

6:18 pm on Dec 13, 2003 (gmt 0)

10+ Year Member



this is what i have been doing. it just seems to be taking me a long time.

thanks. :)

infusion

6:21 pm on Dec 13, 2003 (gmt 0)

10+ Year Member



I do not know anything about PHP. I have a client that needs his site converted. So .. all I have been doing is saving the pages from browser, then saving as html.

The big problem is changing all of the links inside the pages.

I thought there might be some software that does this automatically -- i see so many programs that change PHP to HTML.

DrDoc

6:22 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I'm afraid you'd have to check them manually anyway... just to be on the safe side.
JUOC, why does your client want the pages converted?

mipapage

6:26 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm, I can't find where I'd read it, but it involved using PHP's fread to get the HTML from a dynamic page into a variable, and then fwrite to write that data into a file.

I believe you may want to search for 'semi dynamic pages'. This script would make your job lightening fast, provided that you have a list of the url's for the dynamic pages that you are after.

mipapage

6:31 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The big problem is changing all of the links inside the pages.

Why do you have to do this?

DrDoc

6:35 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...to point to '###.html' instead of '###.php' I guess.

infusion

6:37 pm on Dec 13, 2003 (gmt 0)

10+ Year Member



the programmer said that the site has become too hard on the database. I am not sure why I am doing this, really!

:D

i just checked and there are actually 787 pages on the site .. I was told 200. This is sooo not fun.

thanks for listening!

mipapage

6:38 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Riiight. Gotta stop banging my head on the wall [webmasterworld.com], it's clearly not working.

DrDoc

6:38 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, then you tell the programmer that PHP files have nothing to do with the database :)

infusion

6:42 pm on Dec 13, 2003 (gmt 0)

10+ Year Member



hmm ... i think he has all the customer information stored in this php format .. the people that work there access the customer info online. :/

does that sound right?

DrDoc

6:50 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That sounds about right...

But still, if the database is overloaded, that has nothing to do with the use of PHP vs HTML pages.

mipapage

7:09 pm on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



infusion,

FYI - a dynamic page is generated on the fly, every time there is a request for that page. This would tax the database, provided that the content for the dynamic page is coming from the database.

If a pages content doesn't change very often, then people sometimes use what is referred to as a semi-dynamic page - you take a dynamic page (i.e. a PHP page generated with content from the database) and then save the generated HTML to be used as the live page.

Any time the content for the semi-dynamic page needs to be changed, it is done so in the database, the dynamic page regenerated, and html saved again to be used as the live page.

DanA

8:14 pm on Dec 13, 2003 (gmt 0)

10+ Year Member



If you want to convert the static part of your php site into html, you should use a web copier, it will link all the pages and rename everything if there's not too much javascript involved.

[edited by: tedster at 9:48 pm (utc) on Dec. 13, 2003]

Symbios

9:01 pm on Dec 13, 2003 (gmt 0)

10+ Year Member



The easiest way is to download the whole site using a utility (Do a search in Google).

When you have downloaded the site use a bulk file renamer to change the sufixes from .php to .html. It shouldn't take more than 30 minutes.

[edited by: tedster at 9:47 pm (utc) on Dec. 13, 2003]

infusion

10:52 pm on Dec 13, 2003 (gmt 0)

10+ Year Member



thank you, mipapage, Symbios and DanA. that clears it up for me.

ergophobe

11:00 pm on Dec 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




...to point to '###.html' instead of '###.php' I guess.

You could
- force *.php to be parsed as html
- use modRewrite to rewrite *.html to *.php or vice versa or whatever
- use a regex tool and change *.php to *.html (okay, you can't do that because of external links, but if you put your domain name in the regex it should work).

In terms of changing the pages to html, Google on 'wget'. You should be able to do it that way pretty quickly as long as you don't have a lot of orphan pages.

Tom

dlab

12:49 am on Dec 15, 2003 (gmt 0)

10+ Year Member



I think it would be easier to use ModRewrite, just add something like


RewriteEngine on
RewriteRule ^([[:punct:]/:\\-\'(){}.&=_a-zA-Z0-9\ ]*).html $1.php

into a .htaccess file and every php page (ex. home.php) will become a html page, and will appear to be static (ex. home.html) you will still be able to access the php file like normal, but you will also be able to access it like a html file.. just make sure your host has ModRewrite enabled and you are allowed to use it. Oh yeah, you can use this to shorten your php file names (ex. modules.php?name=testerthingy&page=1 could be test-1.html)


RewriteRule ^test-([0-9]*).html modules.php?name=testerthingy&page=$1

You can even make files look like dirs..


RewriteRule ^weather/([0-9]*) weather.php?zip=$1

so if you went to weather/97222 you would be seeing weather.php?zip=97222.. There are a lot of things you can do with ModRewrite..

IeuanJ

3:56 pm on Dec 17, 2003 (gmt 0)

10+ Year Member



Has no one at the company thought that they will be negating the reason they had a php site in the first place? They will no longer be able to update info as easily.

If the database is taking a hammering I would suggest they get a better database, or else try simplifying some of the sql commands by using views and queries internal to the db itself.