/home/mjc1/public_html/emillennium/ajax_chgpassProcess.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
<?php
$dir 
".";
include_once(
$dir."/_common.php");

$mode_ok "N";

if(
$eid!=''){
    
$sql "select * from member where Mid = '$eid' ";
    
$res mysql_query($sql,$connect_web);
    
$mem_info mysql_fetch_array($res);
    if(
$mem_info['Mid']!=''){
        
$sha_oldpass sha1(md5($oldpass));
        
$sha_nowpass $mem_info['Mpassword2'];
        if(
$sha_oldpass==$sha_nowpass){
            
$ch_pass sha1(md5($newpass));
            
$sql "update member set
                            MbeforePWD = '
{$sha_nowpass}', Mpassword2 = '{$ch_pass}', Mpassword = '{$newpass}'
                        where Mid = '
{$eid}'
            "
;
            
mysql_query($sql,$connect_web);
            
$mode_ok "Y";
            
$msg "수정되었습니다.";
        } else {
            
$msg "이전비밀번호가 맞지 않습니다.";
        }
    } else {
        
$msg "해당되는 회원이 없습니다.";
    }
} else {
    
$msg "아이디가 없습니다.";
}

echo 
"<?php xml version='1.0' encoding='utf-8'?><output>";
echo 
"<mode>".$mode."</mode>";
echo 
"<mode_ok>".$mode_ok."</mode_ok>";
echo 
"<rtn_url>".$rtn_url."</rtn_url>";
echo 
"<msg>".$msg."</msg>";
echo 
"<sql>".$all_sql."</sql>";
echo 
"</output>";

?>