} if (isset($_POST['username'])) { define('ACCESS', '1'); include 'conn/connect.php'; include 'conn/operate.php'; if (trim($_POST['username']) == "" || trim($_POST['password']) == "") { $errurl = "javascript:window.history.go(-1)"; $errinfo = "用户名和密码不能为空!"; include 'templete/err.html'; } if (@(!mysql_fetch_array(mysql_query('select id from member where username = "******" and password="******"')))) { $errurl = "javascript:window.history.go(-1)"; $errinfo = "用户名或者密码错误!"; include 'templete/err.html'; } operate::loginsession($_POST['username']); header("Location: member.php"); } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <title>登录 - Handicrafts</title> <?php include 'templete\\header.html'; ?> <script> function userLogin() {
define('ACCESS', '1'); session_start(); include 'conn/connect.php'; include 'conn/operate.php'; if (!isset($_SESSION['username'])) { header("Location: login.php"); } if (isset($_POST['act'])) { if ($_POST['act'] == 'edit_profile') { //修改信息 if (trim($_POST['password']) == '') { operate::updateoneline('member', array('Email', 'name', 'phone', 'qq'), array($_POST['Email'], $_POST['name'], $_POST['phone'], $_POST['qq']), 'username = "******"'); } else { operate::updateoneline('member', array('password', 'Email', 'name', 'phone', 'qq'), array(md5($_POST['password']), $_POST['Email'], $_POST['name'], $_POST['phone'], $_POST['qq']), 'username = "******"'); } operate::loginsession($_SESSION['username']); $errurl = "javascript:window.history.go(-1)"; $errinfo = "修改成功!"; include 'templete/err.html'; } else { if ($_POST['act'] == 'rent') { //检测数据填写情况 if (trim($_POST['title']) == "" || empty($_FILES) || trim($_FILES['pic']['name']) == "" || !isset($_POST['select2'])) { $errurl = "javascript:window.history.go(-1)"; $errinfo = "物品名称、商品主图、地区信息必须填写!"; include 'templete/err.html'; } //上传图片 $pic = ''; if (!empty($_FILES)) { $path = "upload/";