Save image name by user id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I need help to upload image with member id, like "m_id_filename.jpg"
just not to overwrite file.

This is the path, and  i m sending m_id on image upload page..on this
page i am uploading 12 images, and i want to save every image with
m_id number, Ex:m_id_imagename.jpg 

http://localhost/jobsmp/upload_photos.php?m_id=12

folder name is "uploads" on which i m uploading images.

here is the code for single image upload...



if (is_uploaded_file ($_FILES['image_1']['tmp_name'])) {
		if (move_uploaded_file($_FILES['image_1']['tmp_name'],
"uploads/{$_FILES['image_1']['name']}")) { // Move the file over.

			echo '<p>The file has been uploaded!</p>';

		} else { // Couldn't move the file over.
			echo '<p><font color="red">The before image could not be
moved.</font></p>';
			$image_1 = '';
		}
		$image_1 = $_FILES['image_1']['name'];
	} else {
		$image_1 = '';
	}

Please help me wth it...if possible modify the same code so it will be
easy for me.

Thank you so much!
Avi		


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux