0

Basically, I am setting up a Drag and Drop section of my site that will be within a <form> tag, but instead of submitting the content as integers or whatever, I'd like to print that area, of the webpage (or the entire page itself), out into an image using PHP imagepng() function when they are submitting the form and save it somewhere on the server. Is this possible?

Any ideas on where to start for something like this?

Any help on how to get started with something like this is very appreciated. Wondering if I can use COM() to load up a resource for this or maybe there is a way to do this other than PHP?

Solomon Closson
  • 6,111
  • 14
  • 73
  • 115
  • You want to save a screenshot of the **user's** browser? – Popnoodles Jan 11 '14 at 12:01
  • On my website yes... Only on 1 page of my website. – Solomon Closson Jan 11 '14 at 12:02
  • I don't think you can, but you could send back all the information required to recreate what they see to the server, recreate it and dump it to an image. Not sure why you would want to do this. – Popnoodles Jan 11 '14 at 12:03
  • @Popnoodles - The page is very dynamic and provides a WYSIWYG environment where the user can drag and drop areas of it to whereever they want. They are creating something. Once they create it, I need them to be able to submit it, via a picture so that I can see what they created and get to work on it from my end of it. – Solomon Closson Jan 11 '14 at 12:05
  • This is a way for people to give me a better representation of what they want, instead of just words on a form. Cause a picture says a thousand words and takes less time to create than to actually type out a thousand words. – Solomon Closson Jan 11 '14 at 12:12
  • If you provide a wysiwyg environment why don't you simply save the html in your database so you can render it yourself? – PeeHaa Jan 11 '14 at 12:17
  • Ok, but how would I get the finished HTML into my database? `file_get_contents` won't work since it will get the contents of the webpage before any changes were made. So what can we use to get the html after the changes were made? – Solomon Closson Jan 11 '14 at 12:19
  • 1
    Use javascript to get the contents of your contenteditable and dump in it a hidden field in your form *or* make do an xhr to submit the data directly. – PeeHaa Jan 11 '14 at 12:20
  • Ok, that seems possible... hmmm, would have to use `htmlentities`, that sounds like a plan. – Solomon Closson Jan 11 '14 at 12:22

0 Answers0