Here is my working image upload and rename code, I however need some assistance to resize the image that is being uploaded.
Upload Code:
// Upload File to Directory
$code = md5(time());
$image = $_FILES['userfile']['name'];
$imagename = $code.$image;
$file_name = basename($_FILES['userfile']['name']);
$uploaddir = '../_gallery/' . $imagename;
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
Store to MySQL:
$sql="UPDATE b_thome SET
hdescription = '$front_description',
himg = '$uploadfile',
hndescription = '$right_description',
hfacebook='$facebook_link',
htwitter='$twitter_link'
WHERE locationid = '$location'";
Is there a easy way to resize the image set 600 x 800px?
Thanks!
use the GD library to resize it, it offers all the function you could ask for images management. With it you could use a function like this to create a image that is a reduction of the first one: