查看文件: body_changepassword.php
大小: 4.48 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php $write='N'; if ((isset($_POST["MM_update1"])) && ($_POST["MM_update1"] == "formpass")) { if($_POST['passwd2']==""){ $write='S'; } if ($write=='N'){ if($_POST['passwd2']<>$_POST['passwd3']){ $write='H'; } } if ($write=='N'){ mysql_select_db($database_BE2, $BE2); $query_Rt3 = sprintf("SELECT * FROM member WHERE mem_auto = '%s'",$_SESSION['login_memid']); $Rt3 = mysql_query($query_Rt3, $BE2) or die(mysql_error()); $row_Rt3 = mysql_fetch_assoc($Rt3); if ($_POST['passwd1']<>$row_Rt3['mem_passwd']){ $write='C'; } mysql_free_result($Rt3); } if ($write=='N'){ $updateSQL = sprintf("UPDATE member SET mem_passwd=%s WHERE mem_auto=%s", GetSQLValueString($_POST['passwd2'], "text"), GetSQLValueString($_SESSION['login_memid'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $write='Y'; } } ?> <? if($write<>'N'){ echo "<SCRIPT LANGUAGE='javascript'>"; if($write=='C'){ echo "alert('原始密碼輸入錯誤 1...');";} else if($write=='S'){ echo "alert('新密碼不可空白 2...');";} else if($write=='H'){ echo "alert('新密碼不吻合錯誤 3...');";} else if($write=='C1'){ echo "alert('您的安全舊密碼輸入錯誤 4...');";} else if($write=='S1'){ echo "alert('新安全密碼不可空白 5...');";} else if($write=='H1'){ echo "alert('新安全密碼不吻合錯誤 6...');";} else if ($write=='Y'){ echo "alert('密碼已更新...');";} else if ($write=='Y1'){ echo "alert('安全密碼已更新...');";} echo "</SCRIPT>"; } ?> <!-- start: Content --> <div class="main "> <div class="row"> <div class="col-lg-12"> <h3 class="page-header"><i class="fa fa-indent"></i>修改個人資料</h3> <ol class="breadcrumb"> <li><i class="fa fa-home"></i><a href="index.html">首頁</a></li> <li><i class="fa fa-list-alt"></i><a href="#">個人資料</a></li> <li><i class="fa fa-indent"></i>修改密碼</li> </ol> </div> </div> <div class="row"> <div class="col-sm-6"> <div class="panel panel-default"> <div class="panel-heading"> <h2><i class="fa fa-indent red"></i><strong>登入密碼</strong></h2> </div> <div class="panel-body"> <form action="" method="post"> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">原始密碼</label> <div class="col-md-9"> <input name="passwd1" type="password" class="form-control" id="passwd1" placeholder="最多12位數字或字母" maxlength="12"> <span class="help-block">請輸入原始密碼</span> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">新密碼:</label> <div class="col-md-9"> <input name="passwd2" type="password" class="form-control" id="passwd2" placeholder="最多12位數字或字母" maxlength="12"> <span class="help-block">請輸入新密碼</span> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">重復新密碼:</label> <div class="col-md-9"> <input name="passwd3" type="password" class="form-control" id="passwd3" placeholder="最多12位數字或字母" maxlength="12"> <span class="help-block">請再次輸入新密碼</span> </div> </div> <div class="form-group form-actions"> <button type="submit" class="btn btn-primary">保存</button> </div> <input type="hidden" name="MM_update1" value="formpass" /> <input name="id" type="hidden" id="id" value="<?= $_SESSION['login_memid'] ?>" /> </form> </div> </div> </div> <!--/row--> </div> <!-- end: Content --> <br><br><br> </div><!--/container-->
保存
取消
返回文件列表