By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,712 Members | 1,553 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,712 IT Pros & Developers. It's quick & easy.

web page capture / compression

P: n/a
I'm working on an app where a page is created dynamically via a CMS,
and I need to save the page similar to the way you can save a
'complete web page' via a browser. I need to save the graphics,
links, embedded applets, flash, etc.

Is there any way that I can use native PHP code to 'capture' the web
page and maintain the functionality of the page?
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Steve High wrote:
I'm working on an app where a page is created dynamically via a CMS,
and I need to save the page similar to the way you can save a
'complete web page' via a browser. I need to save the graphics,
links, embedded applets, flash, etc.

Is there any way that I can use native PHP code to 'capture' the web
page and maintain the functionality of the page?


AFAIK, not unless you count using system() or exec() ;) in that case,
you could call up wget to do the capture and saving of files.

--
Justin Koivisto - sp**@koivi.com
http://www.koivi.com
Jul 17 '05 #2

P: n/a
Hello,

On 09/27/2004 06:00 PM, Steve High wrote:
I'm working on an app where a page is created dynamically via a CMS,
and I need to save the page similar to the way you can save a
'complete web page' via a browser. I need to save the graphics,
links, embedded applets, flash, etc.

Is there any way that I can use native PHP code to 'capture' the web
page and maintain the functionality of the page?


You may want to try this HTTP client class to retrieve the current page
HTML. If you need to login the class can also handle the eventual
cookies and redirection if needed. Than you need to parse the HTML and
figure which other elements you need to retrieve and save.

http://www.phpclasses.org/httpclient
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #3

P: n/a
sc****@comcast.net (Steve High) wrote in message news:<52**************************@posting.google. com>...
I'm working on an app where a page is created dynamically via a CMS,
and I need to save the page similar to the way you can save a
'complete web page' via a browser. I need to save the graphics,
links, embedded applets, flash, etc.

Is there any way that I can use native PHP code to 'capture' the web
page and maintain the functionality of the page?


Hmmm. I figured out how to do it...so i will post here in case anyone
else has the same problem.
I used cURL to grab the url as a file stream, then parsed the
<object>, <img>, and <applet> tags to look for the source. I then
created a dynamic 'images' directory and an 'objects' directory where
the images, swfs, and applet jars are stored.
Then i replaced the source in the file stream to point to my new
directories. Finally, i bundled the files and folders with php
compression utility to make one zip-readable file...

it's a lot of jerry-rigging, but it works pretty well.
anyone interested in the source should email me.
Jul 17 '05 #4

P: n/a
Steve -

I'm looking for a compression utility I can use from PHP on a server that
gives me WinZip-compatible files for convenient user download.

I noticed in an old post of your a passing reference to how you
"...bundled the files and folders with php compression utility"

Could you give me a few more details?

Many thanks

Tony Reynolds
Jul 21 '05 #5

P: n/a
JDS
On Tue, 19 Jul 2005 10:53:55 -0400, tonyreynolds wrote:
I'm looking for a compression utility I can use from PHP on a server that
gives me WinZip-compatible files for convenient user download.


On a Linux host? Try "zip"

--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.