...

View Full Version : Change HTML to an Image file



Yay
02-09-2010, 05:01 PM
Hi there,

Is there any way I can make the HTML output (I'm using $_GET, so its necessary that its an output of the page) to an image file?

Basically, when a user clicks a button, it then makes an image out of the current HTML window (or frame), and stores it in a certain directory.

Any help with this would be great.

JAY6390
02-09-2010, 05:15 PM
If you want this doing from remote computers the answer is no. If you are doing this locally then yes its possible but tricky. Theres a function called imagegrabwindow (http://uk.php.net/manual/en/function.imagegrabwindow.php) but you can't do this on any computer but the server

MattF
02-09-2010, 05:15 PM
Search. The question has been asked many times before.

Yay
02-09-2010, 05:38 PM
I'll add some new details:

I'm running MAMP (Mac), and here's the run-down of my PHP process:

a) User clicks a button, which uses $_GET to get the value of 'name' from a LEFT JOIN, then, <?php $_GET['name'] ?> is a value of a somewhat invisible input box.

b) When a user clicks another button, it makes a JPG version of the webpage, and stores it in a directory, and the file name is based on the <?php $_GET['id'] ?> ID of the person.

Any help towards a script which does this would be appreciated.

JAY6390
02-09-2010, 05:41 PM
You haven't said if people will be accessing this from a computer other than the server. If they are then you cannot capture the screen. To clarify, if this is to be web based and not just on a standalone computer it will NOT be possible

Yay
02-09-2010, 05:49 PM
You haven't said if people will be accessing this from a computer other than the server. If they are then you cannot capture the screen. To clarify, if this is to be web based and not just on a standalone computer it will NOT be possible

This system will not be web-based. Ever.

martin.lawrence
02-12-2010, 12:07 PM
You have to provide a path to the image. HTML documents use URLs for paths. If the image is in the same directory as your html file, then you use the filename.

The tag is "img":

<img src="myImage.jpg">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum