Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save dynamic PHP page for offline viewing

I have a PHP page foo.php that pulls records from a MySQL database and displays them in a nice way. The tricky part is I have links at the top like "Sort by Name" that link to foo.php?sort=name.

My general question is if I have several POST variables like sort, there is an exponential number of possible pages (a few hundred in my case). Is there a good way to save all those pages for offline viewing? In the absence of a better solution I guess I can use a tool like wget to download all the possible combinations of the page. If this is the solution, can you recommend better tools for this task?

Edit: To answer the question of why I need this: I have a dynamic program for a conference ISPC 20 that I need to hand out to people on a usb flash drive. I don't think providing a WAMP solution is an option in this case.

like image 293
Alan Turing Avatar asked Oct 10 '22 12:10

Alan Turing


1 Answers

Just ship a minimal webserver along with the PHP code. Much easier. Some options:

  • MicroApache can run off a 1.44Mb floppy
  • MoWeS is a small, modular webserver stack based off Apache, designed to run off an USB stick.
  • QuickPHP is a microserver usually used for testing. But it may suit your needs.
  • NanoWeb is written in PHP. Your clients will need PHP installed, but not a webserver.
  • PHP itself may in the future get a built-in webserver just like e.g. Python and Ruby have. Here's a patch that implements it.
like image 55
Sander Marechal Avatar answered Oct 20 '22 05:10

Sander Marechal