常代码
2017-01-23 10:58
447 查看
账户修改 间接或其他表数据
View Code
<?php require 'includes/common.inc.php'; session_start(); if ( !isset($_SESSION['username']) ) { _location('请先登录','login.php'); } if ( isset($_GET['id']) ) { $_sql = "SELECT * FROM tb_user WHERE id = '{$_GET['id']}'"; $_result = _query($_sql); $_rows = _fetch_array($_result); $_html = array(); $_html['userName'] = $_rows['userName']; $_html['userEmail'] = $_rows['userEmail']; $_html['userPwd'] = $_rows['userPwd']; $_html['tradingPwd'] = $_rows['tradingPwd']; $_html['encryptedQuestion'] = $_rows['encryptedQuestion']; $_html['encryptedAnswer'] = $_rows['encryptedAnswer']; $_html['realName'] = $_rows['realName']; $_html['province'] = $_rows['province']; $_html['theCity'] = $_rows['theCity']; $_html['county'] = $_rows['county']; $_html['address'] = $_rows['address']; $_html['qq'] = $_rows['qq']; $_html['phone'] = $_rows['phone']; $_html['integral'] = $_rows['integral']; $_html['cash'] = $_rows['cash']; $_html['state'] = $_rows['state']; $_html['identity'] = $_rows['identity']; $_sqlProvince = "SELECT areaName FROM tb_area WHERE id = '{$_html['province']}'"; $_resultProvince = _query($_sqlProvince); $_rowsProvince = _fetch_array($_resultProvince); $_sqlCity = "SELECT areaName FROM tb_area WHERE id = '{$_html['theCity']}'"; $_resultCity = _query($_sqlCity); $_rowsCity = _fetch_array($_resultCity); $_sqlCounty = "SELECT areaName FROM tb_area WHERE id = '{$_html['county']}'"; $_resultCounty = _query($_sqlCounty); $_rowsCounty = _fetch_array($_resultCounty); $_html = _html($_html); } if ( isset($_GET['id']) && $_GET['action'] == 'update' ){ $_clean = array(); $_clean['userPwd'] = md5(_check($_POST['userPwd'])); $_clean['tradingPwd'] = md5(_check($_POST['tradingPwd'])); $_clean['encryptedQuestion'] = _check($_POST['encryptedQuestion']); $_clean['encryptedAnswer'] = _check($_POST['encryptedAnswer']); $_clean['state'] = _check($_POST['state']); $_clean['identity'] = _check($_POST['identity']); $_sql = "UPDATE tb_user SET userPwd = '{$_clean['userPwd']}', tradingPwd = '{$_clean['tradingPwd']}', encryptedQuestion = '{$_clean['encryptedQuestion']}', encryptedAnswer = '{$_clean['encryptedAnswer']}', state = '{$_clean['state']}', identity = '{$_clean['identity']}' WHERE id = '{$_GET['id']}'"; _query($_sql); if ( _affected_rows() == 1 ) { _close(); _location('修改成功!','user.php'); } else { _close(); _alert_back('修改失败!'); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>后台管理--修改会员信息</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #F8F9FA; } --> </style> <link href="images/skin.css" rel="stylesheet" type="text/css" /> </head> <body> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td> <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2"> <tr> <td height="31"><div class="titlebt">会员管理</div></td> </tr> </table></td> <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td> </tr> <tr> <td height="71" valign="middle" background="images/mail_leftbg.gif"> </td> <td valign="top" bgcolor="#F7F8F9"><div> <!----> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="left_txt" >当前位置:修改会员</td> </tr> <tr> <td><table width="47%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable"> <form name="admin" id="admin" method="POST" action="?action=update&id=<?php echo $_GET['id']?>"> <tr class="left_txt2" align="right"> <td width="21%" class="left_txt2" bgcolor="#F2F2F2">账号名称:</td> <td width="32%" class="left_txt2" bgcolor="#F2F2F2" align="left"><?php echo $_html['userName'] ?></td> <td width="17%" class="left_txt2" bgcolor="#F2F2F2">省:</td> <td width="30%" align="left" class="left_txt2" bgcolor="#F2F2F2"><?php echo $_rowsProvince['areaName']?></td> </tr> <tr class="left_txt2" align="right" > <td class="left_txt2" bgcolor="#F2F2F2">真实名称:</td> <td class="left_txt2" align="left" bgcolor="#F2F2F2"><input type="text" id="realName" name="realName" value="<?php echo $_html['realName'] ?>" /></td> <td class="left_txt2" bgcolor="#F2F2F2">市:</td> <td align="left" class="left_txt2" bgcolor="#F2F2F2"><?php echo $_rowsCity['areaName']?></td> </tr> <tr align="right"> <td class="left_txt2" bgcolor="#F2F2F2">会员密码:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><input type="password" name="userPwd" id="userPwd" value="<?php echo $_html['userPwd'] ?>"/></td> <td class="left_txt2" bgcolor="#F2F2F2">县:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><?php echo $_rowsCounty['areaName']?></td> </tr> <tr align="right"> <td class="left_txt2" bgcolor="#F2F2F2">交易密码:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><input type="password" name="tradingPwd" id="tradingPwd" value="<?php echo $_html['tradingPwd'] ?>" /></td> <td class="left_txt2" bgcolor="#F2F2F2">详细地址:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><?php echo $_html['address'] ?></td> </tr> <tr class="left_txt2" align="right"> <td class="left_txt2" bgcolor="#F2F2F2">账号邮箱:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><?php echo $_html['userEmail'] ?></td> <td class="left_txt2" bgcolor="#F2F2F2">QQ:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><?php echo $_html['qq'] ?></td> </tr> <tr align="right"> <td class="left_txt2" bgcolor="#F2F2F2">密码问题:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><input type="text" name="encryptedQuestion" id="encryptedQuestion" value="<?php echo $_html['encryptedQuestion'] ?>"/></td> <td class="left_txt2" bgcolor="#F2F2F2">电话:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><?php echo $_html['phone'] ?></td> </tr> <tr class="left_txt2" align="right"> <td class="left_txt2" bgcolor="#F2F2F2">密保答案:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><input type="text" name="encryptedAnswer" id="encryptedAnswer" value="<?php echo $_html['encryptedAnswer'] ?>"/></td> <td class="left_txt2" bgcolor="#F2F2F2">积分:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><?php echo $_html['integral'] ?></td> </tr> <tr align="right"> <td class="left_txt2" bgcolor="#F2F2F2">现金:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"><?php echo $_html['cash'] ?></td> <td class="left_txt2" bgcolor="#F2F2F2">状态:</td> <td class="left_txt2" bgcolor="#F2F2F2" align="left"> <select id="state" name="state"> <option value="0" <?php if ($_html['state']==0) echo "selected" ?>>正常</option> <option value="1" <?php if ($_html['state']==1) echo "selected" ?>>冻结</option> </select></td> </tr> <tr> <td class="left_txt2" bgcolor="#F2F2F2" align="right">会员类型:</td> <td class="left_txt2" bgcolor="#F2F2F2" colspan="3"> <select id="identity" name="identity"> <option value="0" <?php if ($_html['identity']==0) echo "selected" ?>>普通会员</option> <option value="1" <?php if ($_html['identity']==1) echo "selected" ?>>企业会员</option> </select> </td> </tr> <tr> <td height="30" colspan="4" align="center" class="left_txt2" bgcolor="#F2F2F2"><input type="submit" name="button" id="button" value="修改" /> <input type="reset" name="button2" id="button2" value="取消" onclick="history.go(-1);"/></td> </tr> </form> </table> </tr> </table> <!----> </div></td> <td background="images/mail_rightbg.gif"> </td> </tr> <tr> <td valign="middle" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td> <td height="17" valign="top" background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17" /></td> <td background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td> </tr> </table> </body> </html>
View Code
相关文章推荐
- php杂乱
- Java Mail实现发送带附件的邮件
- php 10.1总
- Java ActiveMQ Spring ActiveMQ整合+注解消息监听
- Eclipse/MyEclipse 最最常用的快捷键
- ASP对数据库的操作方法
- c++编程和c在思想上最大的差别
- QML TextInput的字体超出控件范围
- QT获取电量状态
- Eclipse Memory Analyze 使用
- java.lang.reflect反射学习
- 用c++11打造类似于python的range
- php中的__call调用
- Spring MVC之@RequestMapping注解详解
- Java语言基础顺序结构语句
- org.springframework.orm.hibernate3.HibernateSystemException: Null value was assigned to a property o
- Java 中的接口有什么作用?
- Spring Web MVC
- 经典String str = new String("abc");内存分配问题
- 浅谈终端直接执行py文件,不需要python命令