brenda Posted June 21, 2011 Share Posted June 21, 2011 Hi, I have code (see 2 docs attached) which allows a user to write text on an image - I am using an image map so that the person can click on part of the image and input their text. My problem is that it only allows text to be written on the image once (even though I will have multiple places on the image map that they can click on) and I need the user to be able to write on it at different places and also at different times. Currently when the text has been written once the user is given a choice whether to open or save the image with the text written on it. How can I offer the user another chance to write text on the image before giving them the choice to open or save it or even afterwards if they want to go back and have another go ? Thanks [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/240038-how-can-i-allow-a-user-to-write-text-on-an-image-more-than-once/ Share on other sites More sharing options...
markjoe Posted June 22, 2011 Share Posted June 22, 2011 maybe instead of sending the image as a download, save it to a temp file and display it, then the user can download or continue altering it. Quote Link to comment https://forums.phpfreaks.com/topic/240038-how-can-i-allow-a-user-to-write-text-on-an-image-more-than-once/#findComment-1233570 Share on other sites More sharing options...
brenda Posted June 22, 2011 Author Share Posted June 22, 2011 Thank you markjoe. Do you mind if I ask you how to do that? Quote Link to comment https://forums.phpfreaks.com/topic/240038-how-can-i-allow-a-user-to-write-text-on-an-image-more-than-once/#findComment-1233573 Share on other sites More sharing options...
markjoe Posted June 22, 2011 Share Posted June 22, 2011 You may want to read some documentation on each step and it should become clear how to fit them together. For example http://us3.php.net/manual/en/function.imagepng.php will tell you that you can give a file name instead of outputting to the browser. You can save it to your systems temp folder or elsewhere and manage (delete when no longer needed) your images yourself. Once the file is saved, you can link to it via a <img/> tag. (if you use the OS temp folder you may need to have a php script retrieve it for you.) At that point you should be back to where you started and the user can do it all over again. Unless you want to provide the ability to undo changes, I would recommend writing newer file over the older version, as to reduce the files to clean up. Quote Link to comment https://forums.phpfreaks.com/topic/240038-how-can-i-allow-a-user-to-write-text-on-an-image-more-than-once/#findComment-1233587 Share on other sites More sharing options...
brenda Posted June 23, 2011 Author Share Posted June 23, 2011 markjoe, You are very generous with your time. Thank you. I am at work now but will work with this over the weekend. I will be SO happy when I get this working as I have spent hours and hours on it. Best wishes Quote Link to comment https://forums.phpfreaks.com/topic/240038-how-can-i-allow-a-user-to-write-text-on-an-image-more-than-once/#findComment-1233611 Share on other sites More sharing options...
brenda Posted June 25, 2011 Author Share Posted June 25, 2011 Hi markjoe, I have now saved the file but when reopened the user can no longer write text to it. It seems that I am gong to have to try to use a while loop so that the user can keep on adding text as they wish. But at least I have got that far. Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/240038-how-can-i-allow-a-user-to-write-text-on-an-image-more-than-once/#findComment-1234810 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.