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? Quote Link to comment 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. Quote Link to comment 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** Quote Link to comment 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. Quote Link to comment 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... Quote Link to comment 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.