sunil_23413 Posted June 25, 2009 Share Posted June 25, 2009 I have a form which has two fields 1. Email 2. Website url When the user submits this form an email goes to the email address filled above which contains the screen shot of the webpage whose url is filled above. I need an image screen shot so that I can send it in an email. Is there a php script which can take screen shot of the webpage for a given url? I used file_get_contents() function but it does not display the webpage properly. Some images and links are not shown. Quote Link to comment https://forums.phpfreaks.com/topic/163611-take-screen-shot-of-the-webpage-for-a-given-url/ Share on other sites More sharing options...
RussellReal Posted June 25, 2009 Share Posted June 25, 2009 is the server on windows hosting and has COM access? if so: <?php $ie = new COM('InternetExplorer.Application'); $ie->fullscreen = true; $ie->visible = true; $ie->Navigate2($theURL); while ($ie->Busy) { com_message_pump(5000); } $i = imagegrabscreen(); $ie->Quit(); imagepng($i); imagedestroy($i); ?> Quote Link to comment https://forums.phpfreaks.com/topic/163611-take-screen-shot-of-the-webpage-for-a-given-url/#findComment-863259 Share on other sites More sharing options...
Adam Posted June 25, 2009 Share Posted June 25, 2009 The links and images won't work as what's probably happening is the email client is rendering the HTML taken from the web page - it's not taking an actual screen shot. As for taking a screen shot, I can't really help you. Google's probably best way to go... Quote Link to comment https://forums.phpfreaks.com/topic/163611-take-screen-shot-of-the-webpage-for-a-given-url/#findComment-863264 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.