1. zm Æú´õ ¹Ø¿¡ photos Æú´õ ¸¸µé°í chmod 777·Î º¯°æ.
2. ¾÷·Îµå ÆÄÀÏ Ã³¸®ºÎºÐ(zm/admin/membermodify.php)
~~
~~
$Query = insertQuery($User,"zm");
mysql_query($Query) or print_error(mysql_error());
==== ¶óÀÎ 64 ¿¡ »ðÀÔ(½Å±ÔºÎºÐ) ====
if ($_FILES["photo"]["tmp_name"]) {
$ext = strtolower(strrchr($_FILES["photo"]["name"],"."));
if($ext==".jpg" || $ext==".png" || $ext==".gif"){
$rewidth = 200;
$reheight = 256;
if($ext==".gif") $dstimg = ImageCreate($rewidth,$reheight);
else $dstimg = ImageCreatetruecolor($rewidth,$reheight);
if($ext==".jpg") $srcimg = ImageCreateFromJPEG($_FILES["photo"]["tmp_name"]);
if($ext==".gif") $srcimg = ImageCreateFromGIF($_FILES["photo"]["tmp_name"]);
if($ext==".png") $srcimg = ImageCreateFromPNG($_FILES["photo"]["tmp_name"]);
Imagecopyresampled($dstimg, $srcimg,0,0,0,0,$rewidth,$reheight,ImageSX($srcimg),ImageSY($srcimg));
ImageJPEG($dstimg,"../photos/".$_POST["user_id"].".jpg",90);
}
unlink($_FILES["photo"]["tmp_name"]);
}
==== ¶óÀÎ 64 ¿¡ »ðÀÔ ²ø====
echo "<meta http-equiv='Refresh' content='0; URL=membermodify.php?user_id=".$_POST["user_id"]."&startPage=1".$etc_key."'>";
exit;
~~
~~
==== ¶óÀÎ 111 ¿¡ »ðÀÔ(º¯°æºÎºÐ) ====
if ($_FILES["photo"]["tmp_name"]) {
$ext = strtolower(strrchr($_FILES["photo"]["name"],"."));
if($ext==".jpg" || $ext==".png" || $ext==".gif"){
$rewidth = 200;
$reheight = 256;
if($ext==".gif") $dstimg = ImageCreate($rewidth,$reheight);
else $dstimg = ImageCreatetruecolor($rewidth,$reheight);
if($ext==".jpg") $srcimg = ImageCreateFromJPEG($_FILES["photo"]["tmp_name"]);
if($ext==".gif") $srcimg = ImageCreateFromGIF($_FILES["photo"]["tmp_name"]);
if($ext==".png") $srcimg = ImageCreateFromPNG($_FILES["photo"]["tmp_name"]);
Imagecopyresampled($dstimg, $srcimg,0,0,0,0,$rewidth,$reheight,ImageSX($srcimg),ImageSY($srcimg));
ImageJPEG($dstimg,"../photos/".$_GET["user_id"].".jpg",90);
}
unlink($_FILES["photo"]["tmp_name"]);
}
==== ¶óÀÎ 111 ¿¡ »ðÀÔ ²ø====
echo "<meta http-equiv='Refresh' content='0; URL=membermodify.php?user_id=".$_GET["user_id"]."&startPage=".$_GET["startPage"].$etc_key."'>";
exit;
3. HTMLºÎºÐ¿¡ Ãß°¡(»çÁø º¸¿©ÁÙ ºÎºÐ)(zm/admin/membermodify.php)
<td>»çÁø</td>
<td><?=(file_exists("../photos/".$Records["user_id"].".jpg"))?"<img src='../photos/".$Records["user_id"].".jpg' width='100'>":"»çÁø¾øÀ½"?></td>
4. <form ű׿¡ enctype="multipart/form-data" »ðÀÔ>(zm/admin/membermodify.php)
5. »çÁø¾÷·Îµå¸¦ À§ÇÑ <input type="file" name="photo"> ÅÂ±× Ãß°¡.(zm/admin/membermodify.php) |
|