Jump to content

Recommended Posts

I know this is probably not possible as php is serverside and screenshots need to be taken client side

 

But is there anyway, to have a button on a webpage which takes a screenshot of a section of your site and saves it to a file. I think the answer to this is probably not...

 

If there is no way of doing it, I guess the solution would be GD with the data off the page, but this would mean coding a gd script for every page of the site.

 

example of what I would want screenshotted:

 

http://www.rstracking.com/records.php

 

on that page, but the screenshot would be the table in the middle. The page is dynamic so it cant be a static image

 

Thanks for the help

Link to comment
https://forums.phpfreaks.com/topic/121393-php-screenshots/
Share on other sites

This is a question out of my capabilities, but what I can surely say is that you can't make it only with PHP or even with JavaScript in the client side. It would need a third party application which creates the screenshots on the fly and saves them somewhere you can easily access. You can use PHP's program execution functions (exec(), system(), etc) to run the external application and show the file upon creation. Don't know such an application so I can't help on it.

Link to comment
https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626014
Share on other sites

You need a 3rd party service to do this or you could grab screenshots from a service like Alexa (if they have the shots available. I think your site needs to be in the DMOZ directory)

 

Try: http://www.artviper.com/tools.php#thumbnails

Link to comment
https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626095
Share on other sites

It is possible to do with PHP.

 

in fact it only requires the GD library and PHP > 5.2.2 ( i believe?)

http://us3.php.net/manual/en/function.imagegrabscreen.php

http://us3.php.net/manual/en/function.imagegrabwindow.php

 

*HOWEVER*

They are windows ONLY functions.

 

On linux I've read of success by using ImageMagick

 

import -window root imagename.png

 

and passing that through system() or exec()

 

But, that would require you to have a GUI running, and be able to interact with any of the browsers that are available on linux.

 

Heres some quick googling on firefox and the shell:

http://xlife.zuavra.net/index.php/45/

http://thedaneshproject.com/posts/shell-script-scripts-to-restart-firefox/

 

I would say its probably possible... but you would need significant system access to accomplish it as well as a server running a full desktop.

Link to comment
https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626151
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.