/home/mjc1/public_html/html/m/customer_education_process.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?
 
include("./_common.php");
 include(
"../../manage/category/common.php");

$DB_HOST  =  "localhost";
$DB_USER  =  "WebHostUser";
$DB_PWD   =  "WebHost5263";
$DB_NAME  =  "webhost";
$sqli_dbcon mysqli_connect($DB_HOST$DB_USER$DB_PWD$DB_NAME);

function 
filter_SQL($content){
    
$content str_replace("&""&amp;"$content); 
    
$content str_replace("<""&lt;"$content);  
    
$content str_replace(">""&gt;"$content);  
    
$content str_replace("'""&apos;"$content);   
    
$content str_replace("\"""&quot;"$content);  
    
$content str_replace("\r"""$content);
    
$content str_replace("'"""$content);   
    
$content str_replace('"'""$content);  
    
$content str_replace("--"""$content);
    
$content str_replace(";"""$content);
    
$content str_replace("%"""$content);
    
//$content = str_replace("+", "", $content); // »ó´ãºÐ¾ß ¼±Åÿ¡¼­ +°¡ µé¾î°¡±â¶§¹®¿¡ ÄÚ¸àÆ®
    
$content str_replace("script"""$content);
    
$content str_replace("alert"""$content);
    
$content str_replace("cookie"""$content);
    
$content SQL_Injection($content);

    return 
$content;
}

function 
SQL_Injection($get_Str) { 
    
$Str =  preg_replace("/(select|union|insert|update|delete|drop|\"|\'|#|\/\*|\*\/|\\\|\;)/i",""$get_Str);
    return 
$Str;
}

//if($_SESSION["nomem_hash".$nomem_hash_h]!=$_SERVER['REMOTE_ADDR']){    echo "Á¢±ÙºÒ·®"; exit; }

    
if($mode=='mobile'){
        foreach(
$_POST as $key=>$val){
            
$_POST[$key] = iconv("utf-8","euc-kr",$val);
            
$_POST[$key] = filter_SQL($_POST[$key]);
        }
        
extract($_POST);
    }

    
$e_tel $e_tel1."-".$e_tel2."-".$e_tel3;
    
$e_date $e_date1."-".$e_date2."-".$e_date3;
    if(
$e_product == "") { 
        
$e_product ""
    }
    
$e_person "";
    
$e_state "½Åû";

    
$stmt mysqli_prepare($sqli_dbcon"INSERT INTO mBoard_education set 
                            e_company = ?, e_name = ?, e_product = ?, e_tel = ?, e_ofc_cnt = ?, e_edu_cnt = ?,
                            e_location = ?, e_purpose = ?, e_date = ?, e_person = ?, e_state = ?, reg_date = ?, mobile = ?"
);
    
// ÆÄ¶ó¹ÌÅ͸¦ ¹ÙÀεù (µ¥ÀÌÅ͠ŸÀÔ¿¡ µû¶ó 'i'´Â Á¤¼ö, 'd'´Â ½Ç¼ö, 's'´Â ¹®ÀÚ¿­)
    
$bind mysqli_stmt_bind_param($stmt"sssssssssssss"$e_company$e_name$e_product$e_tel$e_ofc_cnt$e_edu_cnt$e_location,
    
$e_purpose$e_date$e_person$e_statedate("Y-m-d H:i:s"), $mode);

    
// Äõ¸® ½ÇÇà
    
$exec mysqli_stmt_execute($stmt);

    
// Äõ¸® ½ÇÇà ÈÄ Á¤¸®
    
mysqli_stmt_close($stmt);

    
mysqli_close($sqli_dbcon);

    
/*
    $insertQry  =  "INSERT INTO mBoard_education set 
                            e_company = '{$e_company}', e_name = '{$e_name}', e_product = '{$e_product}', e_tel = '{$e_tel}', e_ofc_cnt = '{$e_ofc_cnt}', e_edu_cnt = '{$e_edu_cnt}',
                            e_location = '{$e_location}', e_purpose = '{$e_purpose}', e_date = '{$e_date}', e_person = '', e_state = '½Åû', reg_date = '".date("Y-m-d H:i:s")."', mobile = '{$mode}'
                        ";

                    MYSQL_QUERY($insertQry);    
    */
    //echo $insertQry; exit;

    
include("../millennium/lib/PHPMailer5/PHPMailerAutoload.php"); // phpmailer 5 ¸ðµâ ±×´©º¸µå 2.0 ¸ðµâÇÏ°í ¸î¸î ¸í·É¾î³ª ´ë¼Ò¹®ÀÚ³ª ±âŸ Æ²¸²

    
$to1='mjsoft@naver.com';
    
$to2='hjw179@naver.com';
    
//$to3='ryunen@naver.com';
    
$to3='sojis2@naver.com';
    
$subject="mjsoft.co Áýü±³À°½ÅûÀÌ µî·Ï µÇ¾ú½À´Ï´Ù.";
    
//$msg="¼º¸í:$username\n¿¬¶ôó:$btellephone\nÁ¦¸ñ:$title\n³»¿ë:$detail";

    
ob_start();
    include 
'customer_education_mail.php';
    
$content ob_get_contents();
    
ob_end_clean();

    
$content str_replace("[==company==]",$e_company,$content);
    
$content str_replace("[==name==]",$e_name,$content);
    
$content str_replace("[==tel==]",$e_tel,$content);
    
$content str_replace("[==ofc_cnt==]",$e_ofc_cnt,$content);
    
$content str_replace("[==edu_cnt==]",$e_edu_cnt,$content);
    
$content str_replace("[==location==]",$e_location,$content);

    
$content str_replace("[==purpose==]",$e_purpose,$content);
    
$content str_replace("[==date==]",$e_date,$content);

    
$mail = new PHPMailer;
    
    
$mail->IsSMTP();
    
$mail->Host "smtp.naver.com";
    
$mail->SMTPAuth true;
    
$mail->Port "465";
    
$mail->SMTPSecure "ssl";        // SSLÀ» »ç¿ëÇÔ
    
$mail->Username "1000y3";
    
$mail->Password "clswjf8680!!";
    
$mail->setFrom("1000y3@naver.com""¿¥Á¦À̼ÒÇÁÆ®");

    
$mail->addAddress($to1);
    
$mail->addAddress($to2);
    
$mail->addAddress($to3);
    
$mail->Subject $subject;
    
$mail->isHTML(true); 
    
$mail->Body "{$content}<br>";
    if (!
$mail->send()) {
        
print_r("¸ÞÀÏ Àü¼Û¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù. <br>º¸³»´Â ¸ÞÀÏ ¼³Á¤À̳ª ¿©·¯°¡Áö¸¦ È®ÀÎÇØº¸½Ã±â ¹Ù¶ø´Ï´Ù. <br>±âÃʵî·Ï->¸ÞÀϼ³Á¤¿¡¼­ ¼³Á¤À» È®ÀÎÇϽñ⠹ٶø´Ï´Ù.<br>");
        
print_r($mail->ErrorInfo);
        exit;
    } else {

    }

    if(
$mode=='mobile'){
?>
<script>
    alert("±³À°½ÅûÀÌ Á¤»óÀûÀ¸·Î Á¢¼öµÇ¾ú½À´Ï´Ù.\n\n±³À°´ã´çÀÚ°¡ 2ÀÏ(±Ù¹«ÀϱâÁØ) À̳» ¿¬¶ô µå¸®°Ú½À´Ï´Ù.\n\n°¨»çÇÕ´Ï´Ù.");
    parent.location.href = "http://<?php echo $_SERVER['SERVER_NAME'];?>/html/m/index.php";
</script>
<?php
    
} else {
?>
<script charset="utf-8">
    alert("±³À°½ÅûÀÌ Á¤»óÀûÀ¸·Î Á¢¼öµÇ¾ú½À´Ï´Ù.\n\n±³À°´ã´çÀÚ°¡ 2ÀÏ(±Ù¹«ÀϱâÁØ) À̳» ¿¬¶ô µå¸®°Ú½À´Ï´Ù.\n\n°¨»çÇÕ´Ï´Ù.");
    parent.location.href = "http://<?php echo $_SERVER['SERVER_NAME'];?>/html/millennium/intro.php";
</script>
<?php
    
}
?>