Jump to content

Image Resize and Create Thumbnails


princeofpersia

Recommended Posts

Hi guys, I have a simple code below which allows to me to upload image  to a file directory and save the location of my file in database

 

the only thing i dont understand is how to 1-resize the images  2- create a thumbnail while uploading 3- allow only jpeg & JPG files to be uploaded with 200kb max

 

also, could you tell me what is the best size i can store the images in?

 

thanks in advance

 

 //image1
$nameone=$_FILES['myfileone']['name'];
$tmp_name=	$_FILES['myfileone']['tmp_name'];
if ($nameone)

{
$locationone="images/$nameone";
move_uploaded_file($tmp_name, $locationone);
$image1 = mysql_query ("UPDATE user SET image1='$locationone'");

}

Link to comment
https://forums.phpfreaks.com/topic/221510-image-resize-and-create-thumbnails/
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.