Good day everybody!

I oledi creating an image using php, now i wanna save the image as a file so that i can use it at other application. Can anyone tell me wat's the function can i use to save the image created and where shud i put it, is it be4 imagedestroy?

Thanks!

JT

    when you call imageimage_format/i you need to supply the second parameter: file-name. Once you do that, you'll have an image that you can use.

    // Save in same folder
    imagegif($im, 'my_image.gif');
    
    // Save in images folder
    imagejpg($im, $_SERVER['DOCUMENT_ROOT'].'/images/my_image.gif');

      Thanks bpat1434!

      Now i am able to save the image. However, the image tat i create after saved cant display in its original application. It only can display at the other application tat i create. How come? can anyone tell me?

      Thanks lot and hv a nice day!

        Who can say, without knowing what applications you're talking about, or what format you're saving the image as, or what format it was in originally?

          ok... i saved the image in jpeg file. Wat i wanna ask is, if the saved image use at other place, then can it still be displayed at the place it is created? Tat's the problem i meet, after i save the imege and use the image at other place, but then i cant open it back wif the file i create it 🙁

            You're making less sense with every post, I'm afraid.

              You save an image on your server. Then access it remotely from another website, right? Then you want to use it on the website that created it right? Well if you don't delete it, you can use the image wherever you want to.

                Jeethau,

                Surely, once you've saved the image you create, a simple html <img> tag will enable you to display it in any browser based application, assuming you've saved it somewhere accessible to a web server.

                Blu

                  Thank you everybody!

                  I hv oledi solved my problem 🙂 Soli if i cant explain well my problem here!

                    Write a Reply...