Take screen shot of the webpage for a given url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sunil_23413
Forum Newbie
Posts: 10
Joined: Thu Mar 12, 2009 5:43 am

Take screen shot of the webpage for a given url

Post by sunil_23413 »

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.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Take screen shot of the webpage for a given url

Post by Darhazer »

You have to use separate software for taking the screenshot, and call it using system(), exec() or any other related function.
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Re: Take screen shot of the webpage for a given url

Post by a94060 »

i did some looking around. There is a function imagegrabscreen() which may do it? I found a link..but lost it somewhere
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Take screen shot of the webpage for a given url

Post by jackpf »

Wow...that website is cool.

I had a look at imagegrabscreen() cause I thought it sounded pretty cool, but for it to work you need to be running windows, and allow apache to access the desktop.

I did that...but I just get a blank image. Idk, maybe you can get it to work...
Post Reply