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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.