/home/mjc1/public_html/html/millennium/consultationBoardP.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<?php 

include_once("./_common2.php");
header("Content-type:text/html;charset=euc-kr");
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(
$_POST['mode']=='mobile'){
    foreach(
$_POST as $key=>$val){
        
$_POST[$key] = iconv("utf-8","euc-kr",$val);
    }
    
extract($_POST);
}

foreach(
$_POST as $key=>$val){
    
$_POST[$key] = filter_SQL($_POST[$key]);
}
extract($_POST);

if( isset(
$subject) && isset($content1)  ){
    
    
$_content       =    addslashes($content1);
    
$reg_date       =    date("Y-m-d H:i:s"); 
    
$tel            =    $tel1."-".$tel2."-".$tel3;
    
$hphone         =    $hp1."-".$hp2."-".$hp3;
    
$faxnum         =    $fax1."-".$fax2."-".$fax3

    if(!isset(
$respon)) $respon "";
    if(!isset(
$estidate)) $estidate "";
    if(!isset(
$productname)) $productname "";
    if(!isset(
$addproduct)) $addproduct "";

    if(
$come_from==''){ $come_from 'mjsoft.co'; }
     

    if(
$_COOKIE['USERID']=='ryunen' || 1==1) {
        if(
$ismode=='visit'){
            
$faxnum $emp_num;
            
$addres "[{$zipcode}{$addr_m} {$addr_d}";
        } else {
            if(
$mode=='mobile'){
                
$smtitle "consult-mobile"// °ßÀû¿äûÀº consult-pc¿Í consult-mobile 2°³·Î Çϱâ·Î Ç졒ʡ¢°¢ Ç¥½ÃºÎºÐÀ» ¸ÂÃç¼­ º¯°æÇؾßÇÔ
            
} else {
                
$smtitle "consult-pc"// °ßÀû¿äûÀº consult-pc¿Í consult-mobile 2°³·Î Çϱâ·Î Ç졒ʡ¢°¢ Ç¥½ÃºÎºÐÀ» ¸ÂÃç¼­ º¯°æÇؾßÇÔ
            
}
        }
        if(
$st_type=='mail_cs'){
            
$smtitle "mail-cs";
        }
        if(
$come_from=='www.easytax.kr' || $come_from=='www.easytax.kr(m)'){
            
$smtitle "tax";
        }
        if(
$come_from=='www.ebizmall.co.kr' || $come_from=='www.ebizmall.co.kr(m)'){
            
$smtitle "biz";
        }
        if(
$iw == 'mail_way'){
            
$content1 "(M)".$content1;
        }
        if(
$mode=='mobile'){
            
$content1 "*".$content1;
        }
        if(
$select_content2 == ""){
            
$select_content2 "";
        }

        if(
$inflow_txt != "") { // À¯ÀÔ°æ·Î ¼±ÅÃÀÌ ÀÖ´Ù¸é
            
$inflow $inflow_txt;
        } else {
            
$inflow "¿äû°Ô½ÃÆÇ Á¢¼ö";
        }

        if(
$name == "") {
            
$name "";
        }

        if(
trim($subject)!='' && trim($tel)!='' && trim($smtitle)!=''){ // ÀÎÁ§¼Ç ¹æÁö
            
$param "20ºÐÀ̳» ¿¬¶ô";
            
$stmt mysqli_prepare($sqli_dbcon"insert into mBoard_install_req set smname = ?, smtel = ?, hptel = ?, faxtel = ?, smtitle = ?, telname = ?, 
                smdetail = ?, contact_time = ?, ipadd = ?, reg_date = ?, s_email = ?, come_from = ?, address = ?, hp_chk = ?, fax_chk = ?, mail_chk = ?, massage_chk = ?,
                prog_select = ?, inflow = ?"
);

            
// ÆÄ¶ó¹ÌÅ͸¦ ¹ÙÀεù (µ¥ÀÌÅ͠ŸÀÔ¿¡ µû¶ó 'i'´Â Á¤¼ö, 'd'´Â ½Ç¼ö, 's'´Â ¹®ÀÚ¿­)
            
$bind mysqli_stmt_bind_param($stmt"sssssssssssssssssss"$subject$tel$hphone$faxnum$smtitle$name$content1$param$_SERVER['REMOTE_ADDR'],
                
date("Y-m-d H:i:s",time()), $txtemail$come_from$addres$hp_chk$fax_chk$mail_chk$massage_chk$select_content2$inflow);

            
/*$insertQry = "insert into mBoard_install_req set smname = '{$subject}', smtel = '{$tel}', hptel = '{$hphone}', faxtel = '{$faxnum}', smtitle = '{$smtitle}', telname = '{$name}', smdetail = '{$content1}',
                contact_time = '20ºÐÀ̳» ¿¬¶ô', ipadd = '".$_SERVER['REMOTE_ADDR']."', reg_date = '".date("Y-m-d H:i:s",time())."', s_email = '{$txtemail}', come_from = '{$come_from}', address = '{$addres}', hp_chk = '{$hp_chk}', fax_chk = '{$fax_chk}', mail_chk = '{$mail_chk}',
                prog_select = '{$select_content2}' ";*/
        
}
        
//echo $insertQry; exit;
    
} else {
        
// °Ô½ÃÆÇ DB ÀÌÀüÀ¸·Î ´õÀÌ»ó »ç¿ë ¾ÈÇÔ
        /*$insertQry  =  " insert into mBoard_consult (company, name, respon, tel, hp, fax, email, hope_date, address, product, add_product, detail, gubun, reg_date, come_from) 
                                                    values ('{$subject}','{$name}','{$respon}','{$tel}','{$hphone}','{$faxnum}','{$txtemail}','{$estidate}','{$addres}','{$productname}','{$addproduct}','{$content1}', 0,'{$reg_date}','{$come_from}')";*/
    
}

    
// ÀüÈ­¹øÈ£°¡ 010À¸·Î ½ÃÀÛÇÏ°í ¸ð¹ÙÀÏÀÏ °æ¿ì¿¡ ¹®Àڹ߼ÛÀÌ ÀÌ·ç¾îÁü
    
if($mode=='mobile'){
        if(
trim($tel)!='' && substr($tel,0,3) === "010") {
            
$sms_userid "mijin";
            
$sms_pswd "1011010";
            
$cttime date("YmdHis",time());
            
$usign sha1($cttime.sha1($sms_pswd));
            
$sms_fromtel "15668680";
            
$sms_msg "õ³â°æ¿µ µ¿¿µ»ó °­ÀÇ º¸±â 
https://mjsoft.co/html/m/customermovie.php"
;
            
$sms_msg iconv("euc-kr","utf8",$sms_msg);

            
$loginUrl "http://psms.mjsoft.co/api/sms_send.php";
            
$login_data "&uid={$sms_userid}&ctime={$cttime}&usign={$usign}&senddate=&phone={$tel}&callback={$sms_fromtel}&msg={$sms_msg}&appcode=17";

            
$ch curl_init(); 
            
curl_setopt ($chCURLOPT_URL,$loginUrl); //Á¢¼ÓÇÒ URL ÁÖ¼Ò 
            
curl_setopt ($chCURLOPT_SSL_VERIFYPEERfalse); 
            
curl_setopt ($chCURLOPT_SSLVERSION,1); 
            
curl_setopt ($chCURLOPT_HEADER0); 
            
curl_setopt ($chCURLOPT_POST1); 
            
curl_setopt($chCURLOPT_POSTFIELDS$login_data); 
            
curl_setopt ($chCURLOPT_TIMEOUT30); 
            
curl_setopt ($chCURLOPT_RETURNTRANSFER1); 
            
$result curl_exec($ch); 
            
$json_data json_decode($result);
        }
    }

    
/*
    if($ismode=='visit'){
        _pr($insertQry); exit;
    }
    */

    //mysql_query($insertQry); 

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

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

    
mysqli_close($sqli_dbcon);
?>

    <script>
    <?php if($smtitle=='visit-pc'){?>
          location.href = "http://<?php echo $_SERVER['SERVER_NAME']?>/html/millennium/customer_visit.php";
          alert("Á¢¼öµÇ¾ú½À´Ï´Ù. ¹æ¹®»ó´ã ´ã´çÀÚ°¡ ¿¬¶ô µå¸®°Ú½À´Ï´Ù.");
    <?php } else if($smtitle=='visit-mobile'){?>
          location.href = "http://<?php echo $_SERVER['SERVER_NAME']?>/html/m/customer_visit.php";
          alert("Á¢¼öµÇ¾ú½À´Ï´Ù. ¹æ¹®»ó´ã ´ã´çÀÚ°¡ ¿¬¶ô µå¸®°Ú½À´Ï´Ù.");
    <?php } else if($mode=='mobile'){?>
          location.href = "http://<?php echo $_SERVER['SERVER_NAME']?>/html/m/customerprice.php";
        alert("Á¢¼öµÇ¾ú½À´Ï´Ù. °ßÀû ´ã´çÀÚ°¡ ¿¬¶ô µå¸®°Ú½À´Ï´Ù.");
    <?php } else {?>
          location.href = "http://<?php echo $_SERVER['SERVER_NAME']?>/html/millennium/customerprice.php";
        alert("Á¢¼öµÇ¾ú½À´Ï´Ù. °ßÀû ´ã´çÀÚ°¡ ¿¬¶ô µå¸®°Ú½À´Ï´Ù.");
    <?php }?>
            
    </script>  

<?php ?>