0

Possible Duplicates:
How can I generate a screenshot of a webpage using a server-side script?
Taking screenshot of a webpage programmatically

How can I make a script in PHP for take a screenshot of a URL?

When I take a URL as an input I would lile to get a screenshot for that URL.

Community
  • 1
  • 1
abhay
  • 19
  • 1

2 Answers2

1

A screenshot is taken from a browser. The only way to do this from server-side PHP code is to make a call to a browser that lives on the server, ask it to go to the URL, and ask it to take a screenshot, and place it somewhere or return it over socket.

Instead of a browser standalone EXE file, you could also use a library that you can call from PHP which has HTML rendering capabilities.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
buddhabrot
  • 1,558
  • 9
  • 14
  • Thanks for your suggestion, but i am beginner for PHP can you tell me in detail. – abhay Nov 24 '10 at 13:05
  • abhay: the url's provided by Colin Pickard lead you to some resources. Although they do not seem to be cross-platform. My suggestion would be to use existing webservices such as http://browsershots.org/ and pay the necessary penalties that come with using such services – buddhabrot Nov 24 '10 at 13:08
  • I downvoted because (a) the original edit suggested the asker was simply confusing server-side and client-side, and I don't agree plus I think that would lead them down the wrong track and (b) the answer seemed way too technical for the asker. – Colin Pickard Nov 24 '10 at 13:17
  • I have since removed my downvote because I added my own answer. – Colin Pickard Nov 24 '10 at 13:18
0

Take a look at these similar Stack Overflow questions, they might help:

Community
  • 1
  • 1
Colin Pickard
  • 45,724
  • 13
  • 98
  • 148