here is my upload code, can you show me how to add in the memory set function listed above?
<?PHP
if ($_POST['photosave'] != '') {
list($height, $width) = getimagesize($HTTP_POST_FILES['picture1']['tmp_name']);
if ($HTTP_POST_FILES['picture1']['name'] != '') {
//get folder number to upload into for folder balance
$query = mysql_query("SELECT * FROM friend_user_photo");
$rownumber = mysql_num_rows($query);
$folder = uploadfolder($rownumber);
//build filename
$filename = $HTTP_POST_FILES['picture1']['name'];
$fil_ext1 = pathinfo($filename);
$fil_ext = $fil_ext1["extension"];
$uniq = uniqid(rand());
$filename = $uniq . $info['auto_id'] . '.' . $fil_ext;
$type = $HTTP_POST_FILES['picture1']['type'];
$PATH = "uploded_files/userphoto/" . $folder;
make_dir($PATH); // iF directory does not exist - make it and chmod 0777
$PATH = $PATH . "/";
if (image_valid($type)) {
$upload = uploadFile1($PATH, $filename, "picture1");
$size = filesize($PATH . $filename);
$size = ceil($size / 2024);
$found = "false";
$fil_explode = '.' . $fil_ext;
$thumb = '_thumb' . $fil_explode;
resizeImg($PATH . $filename, $thumbImage["width"], $thumbImage["height"], $directOutput = false, $quality = 90, 0, $thumb);
$thumb_picture_name = preg_replace("/\.([a-zA-Z]{3,4})$/", $thumb, $filename);
$thumb1 = '_thumb1' . $fil_explode;
resizeImg($PATH . $filename, $thumbImage1["width"], $thumbImage1["height"], $directOutput = false, $quality = 90, 0, $thumb1);
$thumb_picture_name1 = preg_replace("/\.([a-zA-Z]{3,4})$/", $thumb1, $filename);
if ($height > 700) {
$h = 700;
$thumb2 = '_thumb2' . $fil_explode;
resizeImg($PATH . $filename, $width, 700, $directOutput = false, $quality = 90, 0, $thumb2);
echo $thumb_picture_name2 = preg_replace("/\.([a-zA-Z]{3,4})$/", $thumb2, $filename);
unlink($PATH . $filename);
rename($PATH . $thumb_picture_name2, $PATH . $filename);
}
if (FilterALLHTML($caption)) {
$caption = FilterALLHTML($caption);
}
$sqldefault = "select defaultphoto from friend_user_photo where userid='$info[auto_id]'";
$qf = executequery($sqldefault);
$numdef = mysql_num_rows($qf);
if ($numdef == 0) {
$sql = "INSERT INTO friend_user_photo (userid, photo_name, caption,defaultphoto, submitdate) VALUES('$info[auto_id]', '$folder/$filename', '$caption','yes', now())";
executequery($sql);
header("location: $SITE_PATH?p=home");
exit;
} else {
$sql = "INSERT INTO friend_user_photo (userid, photo_name, caption,defaultphoto, submitdate) VALUES('$info[auto_id]', '$folder/$filename', '$caption','no', now())";
}
executequery($sql);
$msg = "Your Photo Successfully Uploaded!.";
} else {
$msg = "Not a valid image only upload jpg ,gif or png!.";
}
} else {
$msg = "Your Photo Not Uploaded !.";
}
if ($info['newregister'] == "yes") {
$msg .= " You can invite your friends";
$_SESSION['sess_msg'] = $msg;
header("location: index.php?action=invite&type=invite&unid=$unid");
exit;
} else {
//$msg .= " Your Photo Successfully Upload!";
$_SESSION['sess_msg'] = $msg;
header("location: $SITE_PATH?p=profile.pics.manage");
exit;
}
}
?>