PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hey guys I am having a problem with images. I want to be able to upload an image and have it resized to a more manageable size (which I have done) but want it to then be saved to the server. How would I go about doing this with the code underneath. Once I have found out how to do this I can change it to suit my needs. this code is straight from http://www.php.net but how would I save $thumb:
Im sorry this is the first time I have tried this and just cannot see how I can save the created image to a folder.
Have looked at three different scripts and as I am not familiar with any of the commands used havng never done this before cannot situate the one that writes the image to the folder.
You only need the header if you are going to output the resulting or original image in the browser, sometimes this is a nice touch though, for example showing them what their thumbnail looks like. But otherwise, if its just to save the thumbnail, no need for headers and all that junk.
Not sure exactly what is wanted here, but I would save the path of the file to a MySQL db, and then copy the file (picture) to a folder named "uploads."
Example, save the path 1_01.jpg in the db, and then copy that same name into the folder to represent your uploaded picture. Then, when you want to display the image, pull the path from the db (1_01.jpg) and place it in a <img> tag, ex:<img src="uploads/1_01.jpg>. Then the <img> tag will refrence the picture named 1_01.jpg that you saved in your "uploads" folder.