0plus1
0plus1

Reputation: 4555

Is there such a thing as a converter from php to html?

Don't think that I'm mad, I understand how php works!

That being said. I develop personal website and I usually take advantage of php to avoid repetion during the development phase nothing truly dynamic, only includes for the menus, a couple of foreach and the likes.

When the development phase ends I need to give the website in html files to the client. Is there a tool (crawler?) that can do this for me instead of visiting each page and saving the interpreted html?

Upvotes: 0

Views: 274

Answers (6)

Dom De Felice
Dom De Felice

Reputation: 476

If you want to use a crawler, I would go for the mighty wget.

Otherwise you could also use some build tool like make.

You need to create a file nameed Makefile in the same folder of your php files.
It should contain this:

all: 1st_page.html 2nd_page.html 3rd_page.html

1st_page.html: 1st_page.php
    php command

2nd_page.html: 2nd_page.php
    php command

3rd_page.html: 3rd_page.php
    php command

Note that the php command is not preceded by spaces but by a tabulation. (See this page for the php command line syntax.)

After that, whenever you want to update your html files just type

make

in your terminal to automatically generate them.

It could seem a lot of work for just a simple job, but make is a very handy tool that you will find useful to automate other tasks as well.

Upvotes: 1

symcbean
symcbean

Reputation: 48357

Pavuk offers much finer control than wget. And will rewrite the URLs in the grabbed pages if required.

Upvotes: 1

jeroen
jeroen

Reputation: 91734

If you're on windows, you can use Free Download Manager to crawl a web-site.

Upvotes: 0

Daniel Papasian
Daniel Papasian

Reputation: 16423

If you need something more powerful that recursive wget, httrack works pretty well. http://www.httrack.com/

Upvotes: 3

Adirael
Adirael

Reputation: 9448

You can use wget to download recursively all the pages linked.

You can read more about this here: http://en.wikipedia.org/wiki/Wget#Recursive_download

Upvotes: 6

Anton Gogolev
Anton Gogolev

Reputation: 115731

Maybe, command line will help?

Upvotes: 0

Related Questions