image resizing
Posted: Fri Sep 07, 2007 5:20 pm
Hey guys, I have a bit of a problem.
I have this script that uploads an image to a server, and then takes the file name and throws it into a sql database.
then i can just use a normal while loop to display the images.
it all works and is fine. But i want to be able to shrink the filesize of the images when they get uploaded. I've tryed integrating other re-size scripts into mine but it never works. Could anybody help me out? Thanks for reading.
I have this script that uploads an image to a server, and then takes the file name and throws it into a sql database.
Code: Select all
$target_path = "../_images/thumbs/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)):
$img = basename( $_FILES['uploadedfile']['name']);
else:
$img = "portfolioPic.jpg";
$placer = '<tr><td colspan="2" id="error" valign="top"><strong>Note:</strong> <em>Either The file you uploaded was too big, or you did not upload a file and we uploaded one for you. 2MB is the limit, so if you tried uploading an image, please shrink your file and try uploading again via the edit project page.</em> </td></tr>';
endif;Code: Select all
while($data = mysql_fetch_array($mysql)):
print'
<tr>
<td rowspan="2">
<img src="../_images/thumbs/'.$data['img'].it all works and is fine. But i want to be able to shrink the filesize of the images when they get uploaded. I've tryed integrating other re-size scripts into mine but it never works. Could anybody help me out? Thanks for reading.