GENERATING THUMBNAIL IMAGES // move the file to (Web and email hosting)

GENERATING THUMBNAIL IMAGES // move the file to the upload folder and rename it $success = move_uploaded_file($_FILES[’image’][’tmp_name’], . UPLOAD_DIR.$username.’/’.$file); } else { // get the date and time ini_set(’date.timezone’, ‘Europe/London’); $now = date(’Y-m-d-His’); $success = move_uploaded_file($_FILES[’image’][’tmp_name’], . UPLOAD_DIR.$username.’/’.$now.$file); } if ($success) { $result = “$file uploaded successfully”; } else { $result = “Error uploading $file. Please try again.”; } break; 7. Change it to this: if ($sizeOK && $typeOK) { switch($_FILES[’image’][’error’]) { case 0: include(’../includes/create_thumb.inc.php’); break; 8 That s it! Save upload_thumb.php and test it by selecting an image from your local file system: a scaled-down copy will be created in the thumbs subfolder of upload_test (see Figure 8-2). Check your code, if necessary, with create_thumb.inc.php and upload_test02.php in the download files. Figure 8-2. A 400 300 pixel image has been automatically resized and renamed on upload. 227
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Leave a Reply