Ad block is installed and active. Please support us by disabling it.
HomeWednesday, April 25, 2018, 08:52:06

Upload and Resize an Image with PHP

Monday, February 9, 15, 01:04:19, 3 Yaers Ago Via wain, Hits: 5973
Tutorial - How to upload and resize image with PHP

$extension = substr(strrchr($current_image, '.'), 1);
if (($extension!= "jpg") && ($extension != "jpeg"))
die('Unknown extension');
$time = date("fYhis");
$new_image = $time . "." . $extension;
$action = copy($_FILES['image']['tmp_name'], $destination);
if (!$action)
die('File copy failed');
echo "File copy successful";
$create = imagecreatefromjpeg($destination);
$currwidth = imagesx($create);
$currheight = imagesy($create);
$ccreate = ImageCreateTrueColor(50,50);
imagecopyresampled($ccreate, $create, 0, 0, 0, 0, 50, 50,
$currwidth, $currheight);
imagejpeg($ccreate, "thumbs/".$new_image);
<form method="post" enctype="multipart/form-data" action="upload.php">
<input type="file" name="image" ><br>
<input type="submit" name="Submit" value="submit">

Mister Sunday, May 22, 2011, 04:03:41

Great tutorials. Thanks for sharing, very useful for me..

Sign In



Preventing multiple form submissions

Preventing multiple form submissions

PHP Mail

Sends an email.

Process Form Data with Jquery

jQuery, Process form data

Creating a basic bad word filter in PHP

This tutorial will show you how to create a basic bad word filter in PHP

Link Base Pro :: Free Link Index Script

This script allows you to manage your links using a MySQL database. It features easy install, user submission, and an admin panel to add, edit and remove categories and links.

View content in a zip file with PHP

List all files in a zip archive with PHP

PHP explode

Explode — Split a string by string.

Sitemap Website Sitemap

Email Link

HTML email link example

Comments 1.1. :: PHP Script

This script allows your visitors to add comments to any single page on your web site.
About Author


Date Registered: Sun, Feb 8, 15
Last Time Online: Sun, Mar 18, 18
So far has created 115 entries.
This author has not yet filled in any details.