Question... What do you do if you're a PHP/MySQL Developer, and you need to take your work with you? This is a problem I ran into last night, as I was preparing my website (where you'll eventually read this article). I've got a few sites that never made it to the internet, but I would like to showcase on my website. I don't want to devote a MySQL database to each and every site I want to put in my portfolio, especially the ones that will only be viewed a handful of times.

It turns out linux's wget command can do exactly what I need it to do. It's as simple as:

wget -r

Just replace my URL with your own. Bear in mind that this will follow every link on every page (as long as it does not leave the domain), so if you point it at a large site, it will take a long time to crawl the whole thing. The other caveat, if you are using GET variables in your links and addresses (which you probably are with PHP/MySQL sites), it's a little trickier.

wget -r -k --html-extension --restrict-file-names=windows

This command is all I needed to flatten an entire site into HTML/CSS and images. The last thing to note is that if you're using CSS background images, it will not follow links inside the CSS, so you'll need to pick those out manually, or just grab the whole image folder and copy it just to be sure.