jscix Posted February 16, 2007 Share Posted February 16, 2007 Ok, what I want to know is, what is the best way to display a php generated image? I have a script that generates the image but I need to display it on a page, so if I use a header command it will just redirect to the image without the page, correct? So I made it generate a .JPG file, then print the HTML to display it, which works well EXCEPT, I want the script to delete the generated .jpg file after having either a successful form submission or a unsucessful form submission(And Generate a new one if form submission failed) which I got it to do..., BUT the problem now is that if the user completly just LEAVES the page, without submitting at all.. the generated image stays in the directory.. which isn't a good thing.. How can I fix this? Any ideas? Link to comment https://forums.phpfreaks.com/topic/38807-need-some-advice/ Share on other sites More sharing options...
Clinger Posted February 16, 2007 Share Posted February 16, 2007 You could set up a cron job that clears out files dating older than a certain point. Link to comment https://forums.phpfreaks.com/topic/38807-need-some-advice/#findComment-186554 Share on other sites More sharing options...
jscix Posted February 16, 2007 Author Share Posted February 16, 2007 Hrmm, I could.. I really want to make this script sulf-suffiecent though. It isn't terribly important, as im just making this as a "learn by doing" kinda thing. Thanks for the imput though, I think I just need to mess with it a bit more. **bashes head on keyboard** Link to comment https://forums.phpfreaks.com/topic/38807-need-some-advice/#findComment-186564 Share on other sites More sharing options...
arifsor Posted February 16, 2007 Share Posted February 16, 2007 put your php file path in html img tag <img src="/dyn.php"> this display your generated pic. Link to comment https://forums.phpfreaks.com/topic/38807-need-some-advice/#findComment-186565 Share on other sites More sharing options...
jscix Posted February 16, 2007 Author Share Posted February 16, 2007 Doh! Thanks alot!!!!!! That saved me a migrain... Link to comment https://forums.phpfreaks.com/topic/38807-need-some-advice/#findComment-186578 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.