@MindzaiJul 31.2009 — #Not directly. A page is rendered by a browser (client), and since PHP is executed on the server it knows nothing of browsers. You [I]could[/I] use PHP to issue sys commands to open a browser on the server and take a screenshot, but it won't make for very portable code.
what i need to do is have PHP take a screen shot of a page on the same server that way i can use that image to something else and then dispose of the image
@MindzaiJul 31.2009 — #Well like I say PHP can't do that itself because how a webpage appears is down to the browser. You will need to send system commands for your OS to execute which will open the browser at the right URL and take the screenshot.
@MindzaiJul 31.2009 — #It really depends on your OS and the software you have installed. It isn't really a PHP issue as all you are doing is executing commands as if using a terminal. For example, on the machine im typing this on (Debian Linux with ImageMagick & Firefox installed), the following works:
[code=php] <?php
exec("firefox 'http://www.google.com'"); exec('sleep 10'); // give the browser time to open and load the page exec('import -window root ~/cap.png');
?> [/code]
But move it to another machine and it may not which is why you will have difficulty moving this code around. If that isn't an issue though then you should be set.