captainjustin
08-25-2009, 10:22 PM
I have a script that works for my website but, I'm not sure how to resize the image. I have tried to figure this out for some time now, but I'm just not having any luck. I would like the image to be resized to 100X100... I have posted the code below and please keep in mind that I'm very new to php... Thanks in advance for any help!
<?
include_once "accesscontrol.php";
$bdir="../member_image/";
if (isset($submitok) && $_FILES[userfile][size] > '0')
{
if (empty($image_name))
{
echo "<center><span class=TNA>You left blank some of the required fields. </span></center>";
}
else
{
$image_id = time()."_".$_FILES[userfile][name];
copy($_FILES[userfile][tmp_name], "../member_image/$image_id");
$q2 = "update members_info set
image_name = \"$_POST[image_name]\",
image_id = \"$image_id\"
where uname = '$_SESSION[uname]' ";
$r2 = mysql_query($q2) or die(mysql_error());
header("location:s_upload.php");
exit();
}
}
unset($submitok);
unset($userfile);
?>
<?
include_once "accesscontrol.php";
$bdir="../member_image/";
if (isset($submitok) && $_FILES[userfile][size] > '0')
{
if (empty($image_name))
{
echo "<center><span class=TNA>You left blank some of the required fields. </span></center>";
}
else
{
$image_id = time()."_".$_FILES[userfile][name];
copy($_FILES[userfile][tmp_name], "../member_image/$image_id");
$q2 = "update members_info set
image_name = \"$_POST[image_name]\",
image_id = \"$image_id\"
where uname = '$_SESSION[uname]' ";
$r2 = mysql_query($q2) or die(mysql_error());
header("location:s_upload.php");
exit();
}
}
unset($submitok);
unset($userfile);
?>