Resize uploaded image

I have spent days looking for a php script that will re size a image to 100 width whilst keeping the original aspect ratio but cant find anything I am capable of implementing.

Please could someone help?

I have the code below working on my site and am able to upload and view specific profile pictures images for the user logged on.

Below is the code I am using. I worked through this from three phpacademy tutorials,

$username = $_SESSION[‘id’];
if ($_POST[‘submit’])
//get attributes
$name = $_FILES[‘myfile’][‘name’];
$tmp_name = $_FILES[‘myfile’][‘tmp_name’];
if ($name)
//start upload
$location = “avartars/$name”;
$query = mysql_query(“UPDATE labourexpress_registration SET imagelocation=’$location’ WHERE reg_id=’$username’”);
echo(“your avatar has been uploaded”);
//check file type check
echo (“Please select a file”);

Any assistance would be appreciated.


check out the gd library.

Sponsor our Newsletter | Privacy Policy | Terms of Service