Áö¿¥Æû¸ÞÀÏÀ̶õ ÇÁ·Î±×·¥ »ç¿ëÇÏ·Á±¸ Çϴµ¥¿ä,
Æû¸ÞÀÏ °ßÀû¼ ÀÛ¼ºÇϸé ÀÛ¼ºµÈ ³»¿ëÀÌ °ü¸®ÀÚ¿¡°Õ ¸ÞÀÏÀÌ ¹ß¼ÛµÇÁö¸¸,
ÀÛ¼ºÀÚ¿¡°Ô´Â ¸ÞÀÏÀÌ ¹ß¼Û µÇÁö ¾Ê´õ¶ó±¸¿ä.
ÀÛ¼ºÀÚµµ ÀÚ½ÅÀÌ ¾´ ³»¿ëÀ» È®ÀÎ ÇÒ ¼ö ÀÖµµ·Ï ¸ÞÀϹ߼ÛÀÌ µÆÀ¸¸é ÁÁ°Ú´Âµ¥...
¾î¶»°Ô ¼öÁ¤ÇÏ¸é µÉ±î¿ä?
¾Æ·¡´Â, send_ok.php ÆÄÀÏ ¼Ò½º ³»¿ëÀÔ´Ï´Ù.
===============================================================================================
include_once ("./LIBsent/config.inc.php");
include_once ("./LIBsent/function.inc.php");
@referer();
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$_POST['code'] = (int)$_POST['code'];
$row = sql_array(query('select * from '.$gm_ed_tb." where no='".$_POST['code']."'"));
if(!$row) msg_chk('Unable to select Table');
extract($row);
$wdate = time();
$set_arr = explode('|:|',$set_array);
$chk_cnt = $set_arr[4] ? count($chk) : false;
$chk = explode(',',$set_arr[4]);
// º¸³»´Â »ç¶÷
$to_name = $_POST['name'] ? adds_trim($_POST['name']) : $name;
$to_mail = $_POST['email'] ? adds_trim($_POST['email']) : $email;
$add_arr = ''; $add_arr = $to_name.'|:|'.$to_mail.'|:|';
// ¿Ï·áÈÄ À̵¿ÇÒ URL
$goUrl = $preve ? adds_trim($preve) : $_SERVER['HTTP_REFERER'];
// ·©±ÍÁö
$languages = $set_arr[0] ? adds_trim($set_arr[0]) : $language;
// ¾ð¾î
include_once ('./languages/'.$languages.'/'.$languages.'.php');
header("Content-Type: text/html; charset=$languages");
// ¼³Ä¡µÈ °æ·Î
function gmform_path(){
$item = explode('/',$_SERVER['PHP_SELF']);
array_pop($item);
$item = 'http://'.$_SERVER['HTTP_HOST'].implode('/',$item);
return $item;
} // end func
$HomeUrl = gmform_path();
// ¸ÞÀÏ Çì´õ
$content = "<html>\n<head>\n<META http-equiv=\"content-type\" content=\"text/html; charset=".$languages."\">\n</head>\n<body>\n";
// ¸ÞÀÏ Å¸ÀÌƲ
$content .= "<table border=0 width=600 cellpadding=2 cellspacing=0 align=center height=29 background=".$HomeUrl."/LIBsent/img/mail_t.gif><tr align=center height=25><td><strong>".$subject."</strong></td></tr></table>\n";
// ¸ÞÀÏ º»¹®
$content .= "<table border=0 width=600 cellpadding=0 cellspacing=0 align=center><tr><td width=20%></td><td width=80%></td></tr>\n";
// POST°ªÀ» ¸ðµÎ ¹è¿·Î ÀúÀå
foreach($_POST as $key => $val){
// ÀÏ¹Ý ÇʼöÇ׸ñ üũ
for($i=0; $i<$chk_cnt; $i++){
$val = trim($val);
$chk2[$i] = $chk[$i];
$chk[$i] = @preg_replace("/upfile/","",@preg_replace("/\[\]/","",$chk[$i]));
if($key == $chk[$i]){
if(empty($val)) msg_chk($chk[$i].' '.$msg['forms_chk']);
$chk2[$i] = '';
}
}
// ³Ñ¾î¿Â POST°ªÁß x, y, code°ªÀº Á¦¿Ü
if(($val==$_POST['code']) || ($val==$_POST['x']) || ($val==$_POST['y'])) continue;
$content .= "<tr height='30'><td> <img src=".$HomeUrl."/LIBsent/img/icon.gif valign=absmiddle> <b>".content_nl2br($key)."</b></td><td> ";
// ¹è¿ÀÌ¸é °ø¹éÀ» ³ÖÀ½
if(is_array($_POST[$key])) {
for($i=0; $i<count($_POST[$key]); $i++) $content .= content_nl2br(str_tags($_POST[$key][$i])).' ';
}
else{
$content .= content_nl2br(str_tags($val));
}
$content .= "</td></tr><tr height=1><td align=center colspan=2 background=".$HomeUrl."/LIBsent/img/line_dot.gif></td></tr>\n";
}
// ¹è¿ ÇʼöÇ׸ñ üũ
if($chk_cnt == true){
for($i=0; $i<$chk_cnt; $i++){
$tmp_arr[$i] = !$chk2[$i] ? true : false;
for($j=0; $j<count($_POST); $j++){
$arr_posted = array_keys($_POST);
if($chk2[$i] == $arr_posted[$j]){
for($k=0; $k<count($_POST[$arr_posted[$j]]); $k++){
if(!empty($_POST[$arr_posted[$j]][$k])) $tmp_arr[$i] = true;
} // end for
} // end if
} // end for
if($tmp_arr[$i]==false){
msg_chk($chk2[$i].' '.$msg['forms_chk']);
} // end if
} // end for
} // end chk_cnt
// µµ¹è±ÛÀ» Â÷´ÜÇϱâ À§ÇÑ Æí¹ý
if(($wdate-$_COOKIE['cookie_wr_spam'][0]) < 30){
msg_chk($msg['forms_spam_ok']);
}
else{
SetCookie("cookie_wr_spam[0]",$wdate,0,'/');
}
// ÷ºÎÆÄÀÏ Á¶ÇÕ
for($k=0; $k<count($_FILES['upfile']['name']); $k++){ $t = $k+1;
if(is_uploaded_file($_FILES['upfile']['tmp_name'][$k]) && ($_FILES['upfile']['size'][$k] > 0)) {
$upfile_tmp .= $_FILES['upfile']['tmp_name'][$k].':'.$_FILES['upfile']['name'][$k].':'.$_FILES['upfile']['type'][$k].'|:|';
$content .= "<tr height=30><td> <img src=".$HomeUrl."/LIBsent/img/icon.gif align=absmiddle> <b>file #".$t."</td><td> ";
// ¼¹ö¿¡ ÆÄÀÏÀ» ÀúÀåÇÑ´Ù¸é..
if($set_arr[2] == 1){
$content .= "<a href=".$HomeUrl."/LIBsent/downloaded.php?code=".$_POST['code']."&file=".base64_encode($_FILES['upfile']['name'][$k].'|:|'.$wdate.'|:|'.$k).">";
}
$content .= $_FILES['upfile']['name'][$k]."</a></td></tr><tr height=1><td align=center colspan=2 background=".$HomeUrl."/LIBsent/img/line_dot.gif></td></tr>\n";
} // end if
} // end for
$upfiles = substr($upfile_tmp,0,-3);
$content .= "</table>\n</body>\n</html>\n";
$subject = adds_trim($subject);
// (1)¹Þ´Â»ç¶÷, (2)¹Þ´ÂÀ̸ÞÀÏ, (3)º¸³»´Â»ç¶÷, (4)º¸³»´ÂÀ̸ÞÀÏ, (5)Á¦¸ñ, (6)³»¿ë, (7)¾ð¾î, (8)ÆÄÀÏ
$send_ok = auto_email($name,$email,$to_name,$to_mail,$subject,$content,$languages,$upfiles);
if($send_ok) {
if($set_arr[2] == 1){
for($k=0; $k<count($_FILES['upfile']['name']); $k++){
if(is_uploaded_file($_FILES['upfile']['tmp_name'][$k]) && ($_FILES['upfile']['size'][$k] > 0)) {
$tmp_file_arr[$k] = base64_encode($_FILES['upfile']['name'][$k].'|:|'.$wdate.'|:|'.$k);
$attach[$k] = $uploaded_dir.'/'.$_POST['code'].'/'.$tmp_file_arr[$k];
@move_uploaded_file($_FILES['upfile']['tmp_name'][$k],$attach[$k]);
@chmod($attach[$k],0606);
$add_arr .= $tmp_file_arr[$k].',';
} // end if
} // end for
} // end if
// ¸ÞÀÏ ³»¿ë µðºñ¿¡ ÀúÀå
query("insert into $gm_sv_tb values('','".$_POST['code']."','".$add_arr."','".$subject."','".adds_trim($content)."','".$_SERVER['REMOTE_ADDR']."','".$wdate."')");
metaHidden($goUrl,($set_arr[1]?adds_trim($set_arr[1]):$msg['forms_email_ok']));
}
else {
msg_chk($msg['forms_email_er']);
}
}
?>
=============================================================================================