screenshot through PHP?

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
User avatar
sploit
Forum Newbie
Posts: 6
Joined: Wed Dec 04, 2002 6:04 am

screenshot through PHP?

Post by sploit »

I need to be able to make the visitors of my site play with a few drag-and-drop images, take a screen shot and then mail it to us.

A javascript drag-n-drop script can be seen at:
http://javascript.internet.com/page-det ... -drop.html

1. The user can press PRINT SCREEN on his keyboard. Through my PHP script, I want to be able to copy that image from the clipboard into a file and email it to myself.
2. Or the user may just click a button/link on my PHP page, which will do all this (screenshot and email) by itself.

Please let me know if this is possible, and if yes... how?
Thanks.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Php is a server side language so it can't see what's in a client PC clipboard. Don't know much about javascript: could js access the clipboard?

You could output the script used to build the page to an html file, then attach that to an email.

If you use absolute links to images in your code (ie http://yoursite.com/etc), the end user could open the html file and view them OK - but only if he's online.

Or you could maybe build a pdf file where (presumably) you can embed images in the document. Haven't looked at the php pdf stuff yet though so not sure.

Don't know if that's much help - might give you some ideas.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

afaik js cannot access the clipboard (and I like it that way)
But you might get the locations of the items of the html-page via js and send those.
User avatar
sploit
Forum Newbie
Posts: 6
Joined: Wed Dec 04, 2002 6:04 am

Post by sploit »

hmm... thanks for the input guys.
so you mean i could use javascript to get the position of the images the user has played around with and then reconstruct another html page and use that...?
thanks.
Post Reply