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

Take screen shot using PHP?

P: n/a
Hello,

Is it possible to take a screen shot of the browser using PHP?

Something similar to Alexa Web Site Screen Dump...

thx

Feb 21 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
On 20 Feb 2007 22:00:00 -0800, "howa" <ho******@gmail.comwrote:
>Hello,

Is it possible to take a screen shot of the browser using PHP?
I don't think you can directly.
But ISTR that, if you have KDE, you can dump Konqueror's screens to
PNG etc.

And I guess this could be "front-ended" with PHP?

But it was a few years ago that I played, and I could be wrong...
--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>
Feb 21 '07 #2

P: n/a
On Feb 21, 8:58 am, David Quinton
<usenet_2005D_em...@REMOVETHISBITbizorg.co.ukwrote :
On 20 Feb 2007 22:00:00 -0800, "howa" <howac...@gmail.comwrote:
Hello,
Is it possible to take a screen shot of the browser using PHP?

I don't think you can directly.
But ISTR that, if you have KDE, you can dump Konqueror's screens to
PNG etc.

And I guess this could be "front-ended" with PHP?

But it was a few years ago that I played, and I could be wrong...
--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>
Dear Howa,

as David said. PHP can not do it by itself. But you can use e.g.
system() to access the print-screen functionality of your operating
system or graphical front end - e.g. KDE.

Good luck
Martin
------------------------------------------------
online accounting on bash bases
Online Einnahmen-Ausgaben-Rechnung
http://www.ea-geier.at
------------------------------------------------
m2m server software gmbh
http://www.m2m.at

Feb 21 '07 #3

P: n/a
Is it possible to take a screen shot of the browser using PHP?
>
Something similar to Alexa Web Site Screen Dump...
No, but JavaScript features a root-html element. I think it is called
DocumentElement. I use this feature to store an HTML "screenshot" along
with annotations to my test sites.

Best regards,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Feb 21 '07 #4

P: n/a
On Feb 21, 4:42 pm, Willem Bogaerts
<w.bogae...@kratz.maardanzonderditstuk.nlwrote:
Is it possible to take a screen shot of the browser using PHP?
Something similar to Alexa Web Site Screen Dump...

No, but JavaScript features a root-html element. I think it is called
DocumentElement. I use this feature to store an HTML "screenshot" along
with annotations to my test sites.
Hello, I am interested in your solution. Can you tell me more abt
this?

Thanks first.

Feb 21 '07 #5

P: n/a
>Is it possible to take a screen shot of the browser using PHP?
>>
I don't think you can directly.
But ISTR that, if you have KDE, you can dump Konqueror's screens to
PNG etc.

And I guess this could be "front-ended" with PHP?

But it was a few years ago that I played, and I could be wrong...
--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>

Dear Howa,

as David said. PHP can not do it by itself. But you can use e.g.
system() to access the print-screen functionality of your operating
system or graphical front end - e.g. KDE.
PHP runs on the server. Any use of system() will also run on the server.
Taking a snapshot of the screen of the server is (a) likely not what
was wanted, (b) a significant security hole on the server, (c) even
if you somehow could get the screen snapshot to work on the client
machine, it's a security breach there also.
Feb 21 '07 #6

P: n/a
howa wrote:
On Feb 21, 4:42 pm, Willem Bogaerts
<w.bogae...@kratz.maardanzonderditstuk.nlwrote:
>>Is it possible to take a screen shot of the browser using PHP?
Something similar to Alexa Web Site Screen Dump...
No, but JavaScript features a root-html element. I think it is called
DocumentElement. I use this feature to store an HTML "screenshot" along
with annotations to my test sites.

Hello, I am interested in your solution. Can you tell me more abt
this?

Thanks first.
comp.lang.javascript.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 21 '07 #7

P: n/a
Gordon Burditt wrote:
PHP runs on the server. Any use of system() will also run on the server.
Taking a snapshot of the screen of the server is (a) likely not what
was wanted,
Well, that's precisely the method used by services like BrowserCam.

Linux/UNIX servers using X11 can have multiple displays. A dedicated
display (e.g. ":1") could be set up as 1024x768 running Opera in full
screen mode.

Then the PHP script calls the following command with system():

opera -remote 'openURL(http://www.example.net/)'

waits a designated amount of time (10 seconds?) and then calls:

import -display :1 -window root /tmp/screen-shot.jpeg

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Feb 21 '07 #8

P: n/a
Hello, I am interested in your solution. Can you tell me more abt
this?
From my (test) site, I open a new window with JavaScript code. This
window has a simple form that allows the user to enter a remark. This
form also has a hidden field "ctlSnapshot".

Before submitting the form, I run the following script:

var strContent = window.opener.document.documentElement.innerHTML;
document.getElementById('ctlSnapshot').value = strContent;

That's it. The HTML of the current page of the test site is submitted
and stored along with the comment.

Best regards.
Feb 21 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.