Jump to content

Updating images


garry

Recommended Posts

I got some help from you guys last night with manipulating a user supplied image but now I need some more help with updating it.

 

Here's the script

 

if (isset($HTTP_POST_FILES['image'])) {

$artistart = $HTTP_POST_FILES['image'];

   if (!empty($HTTP_POST_FILES['image']) && $artistart['type'] == 'image/jpeg')  { 
   		
		$tempimg = $artistart['tmp_name'];

		$tempsize = getimagesize($tempimg);

		$width = $tempsize['0'];
		$height = $tempsize['1'];

		$imglocation = $imgrow['img'];
		$thumblocation = $imgrow['thumb'];

		$filename = DOCUMENT_ROOT . 'artistart/'.$uniq . '.jpg';
		$thumbfile = DOCUMENT_ROOT . 'artistart/thumbs/'.$uniq1 . '.jpg';

		$newwidth = 300;
		$newheight = 300;

		$thumbwidth  = 100;
		$thumbheight = 100;

		$simg = imagecreatefromjpeg($tempimg);
		$timg = imagecreatefromjpeg($tempimg);

			}	
		}

I already have imglocation and thumblocation from the database and that is where the two images are located. What I want to know is how I can use PHP to delete the old images and update them with the new ones.

 

Thanks!!

 

Link to comment
https://forums.phpfreaks.com/topic/108186-updating-images/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.