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, http://www.youtube.com/watch?v=0_bxXgoUJjs.
[php]<?php
$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”;
move_uploaded_file($tmp_name,$location);
$query = mysql_query(“UPDATE labourexpress_registration SET imagelocation=’$location’ WHERE reg_id=’$username’”);
echo(“your avatar has been uploaded”);
//check file type check
}
else
echo (“Please select a file”);
}?>[/php]
Any assistance would be appreciated.
Regards