How to Resize and Upload an Image in PHP



In this tutorial, I will teach you how to resize and upload an image in php. .  This method can control the size of the images when uploading it on your website. It also optimize your web pages and lessen the load of time for a faster browsing experience.

Lets begin:

  1. Create the landing page of your project and name it “index.php”.  Copy  this following code and paste it into file.

<!– extension bootstrap css –>
<link rel=”stylesheet” type=”text/css” href=”css/bootstrap.min.css”>

<h1 align=”center”>Upload and Resize an Image</h1>

<form action=”upload.php” method=”POST” enctype=”multipart/form-data” >
<div class=”container”>
<div class=”row”>
<div class=”col-md-6″>
<div class=”col-md-12″>
<label class=”col-md-3″>Upload Image</label>
<input id=”photo” name=”photo” type=”file”>
<div class=”col-md-12″>
<label class=”col-md-3″>Choose size</label>
<select name=”size_option”>
<input type=”submit” id=”submit” name=”submit” value=”upload”>

<div class=”row”>
<div class=”col-md-12″>
if (isset($_GET[‘image’])) {

header(‘Location: index.php?image=’.$file_name);




For all students who need programmer for your thesis system or anyone who needs a sourcecode in any programming languages.  You can contact me @ :

Email – [email protected]

Mobile No. – 09305235027 – tnt


Dowload the sourcecode here

Looking for more source code? Type your keyword here here!


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.