Ok here it is the upload function that i have on my website, I would like to integrate a resize function on the upload function
so what i want to do is replae this message ... can any body help me?
PHP Code:
$upfile_name[$x]." exceeds the maximum image size limit.<br>
for a resize function
so if the image size is bigger than the maximage then the image is resize
PHP Code:
// UPLOAD FUNCTION
if ($email && $password && $upimages){
$validlogin = verifylogin($email,$password);
if (!$validlogin){
$pagetitle = $ihtitle.": Invalid Email and/or Password";
if ($headerfile) include $headerfile;
print "The email or password you've entered is incorrect. Please go back and try again.";
if ($footerfile) include $footerfile;
exit;
}
if (count($upfile)==0) $uploadstatus = "You haven't selected any files to upload.<br>";
if (!$status && !$uploadstatus){
for($x=0;$x<count($upfile);$x++){
if ($upfile_name[$x]){
$upfilestatus = "";
if (($maximgsize!="") && ($upfile_size[$x]>$maximgsize)) $upfilestatus = $upfile_name[$x]." exceeds the maximum image size limit.<br>";
if (($maximagesperaccount!="") && (numimagesacct($validlogin)>=$maximagesperaccount)) $upfilestatus = $upfile_name[$x]." - You have uploaded the maximum number of images in your account.<br>";
$imgtyp = substr($upfile_name[$x], -3);
$imgtyp = strtolower($imgtyp);
if (($imgtyp!="jpg") && ($imgtyp!="gif") && ($imgtyp!="png")) $upfilestatus = $upfile_name[$x]." is not a valid image (JPG, GIF and PNG only).<br>";
$sql = "select filename from $tablepics where owner='$validlogin' and filename='$upfile_name[$x]'";
$result = mysql_query($sql) or die("Failed: $sql");
$numrows = mysql_num_rows($result);
if ($numrows!=0) $upfilestatus = $upfile_name[$x]." - File already exists.<br>";
if (!$upfilestatus){
$sql = "insert into $tablepics values('', '$validlogin', '$upfile_name[$x]', '$upfile_size[$x]', '0', now())";
$result = mysql_query($sql) or die("Failed: $sql");
@copy($upfile[$x], $upfilesfolder.$validlogin."-".$upfile_name[$x]);
$uppedfiles = $upfile_name[$x]." successfully uploaded.<br>";
}
$uploadstatus .= $upfilestatus;
}
}
}
}
thanks in advance