princeofpersia Posted December 13, 2010 Share Posted December 13, 2010 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 More sharing options...
MMDE Posted December 13, 2010 Share Posted December 13, 2010 You should use these functions... http://php.net/manual/en/ref.image.php oh and they might need to be turned on in the php.ini file! Link to comment https://forums.phpfreaks.com/topic/221510-image-resize-and-create-thumbnails/#findComment-1146659 Share on other sites More sharing options...
princeofpersia Posted December 13, 2010 Author Share Posted December 13, 2010 thanks but can you give me any example in code? im new in php Link to comment https://forums.phpfreaks.com/topic/221510-image-resize-and-create-thumbnails/#findComment-1146663 Share on other sites More sharing options...
litebearer Posted December 13, 2010 Share Posted December 13, 2010 example code(s) http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php Link to comment https://forums.phpfreaks.com/topic/221510-image-resize-and-create-thumbnails/#findComment-1146665 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.