idire Posted August 26, 2008 Share Posted August 26, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/121393-php-screenshots/ Share on other sites More sharing options...
Fadion Posted August 26, 2008 Share Posted August 26, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626014 Share on other sites More sharing options...
JonnoTheDev Posted August 26, 2008 Share Posted August 26, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626095 Share on other sites More sharing options...
idire Posted August 26, 2008 Author Share Posted August 26, 2008 are those paid services? Quote Link to comment https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626141 Share on other sites More sharing options...
mikeschroeder Posted August 26, 2008 Share Posted August 26, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626151 Share on other sites More sharing options...
idire Posted August 26, 2008 Author Share Posted August 26, 2008 I have linux shared hosting, with rather limited access to the server i'm afraid. Quote Link to comment https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626159 Share on other sites More sharing options...
JonnoTheDev Posted August 26, 2008 Share Posted August 26, 2008 not possible Quote Link to comment https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626209 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.