function modify_pass($old, $new) { if (!isset($_SESSION['uid'])) { return array(success => false, message => 'ûÓеǼ'); } global $db_host; global $db_user; global $db_pass; global $db_name; $dblink = new dblink(); $dblink->connect($db_host, $db_user, $db_pass, $db_name); $old_md5 = md5($old); $new_md5 = md5($new); $result = $dblink->query("UPDATE t_user SET pass = '******' WHERE id = '{$id}' AND pass = '******'"); if (is_bool($result) && $result == FALSE) { return array(success => false, message => $dblink->error()); } if ($dblink->affected_rows() == 0) { return array(success => false, message => 'ÔÃÜÂë´íÎó'); } return array(success => true); }
for ($i = 9; $i < count($res) - 1; $i += 14) { $kname[] = urlencode(trim($res[$i + 4])); $kxf[] = urlencode(trim($res[$i + 8])); if (strlen(trim($res[$i + 12])) == 0) { $kscore[] = urlencode('NULL'); $wcount++; } else { $kscore[] = urlencode(trim($res[$i + 12])); } } if (count($kname) != 0) { if ($_GET['type'] == 'kcount') { $yk = strpos($re, ':'); if ($yk != 221) { echo $wcount; } } else { if ($_GET['type'] == 'ncx') { echo urldecode(json_encode(array('kname' => $kname, 'kscore' => $kscore, 'kxf' => $kxf, 'msg' => 'ok'))); } } } else { echo json_encode(array('msg' => 'grade is null')); } require 'dblink.php'; $date = date('Y-m-d H:i:s'); $xh = $_GET['xh']; $sql = "INSERT INTO student (stunum,type,date) VALUES ('{$xh}','grade_app','{$date}')"; $tj = new dblink(); $tj->dbquery($sql); }
<?php require 'dblink.php'; $name = $_GET['username']; $pass = $_GET['pass']; $xh = $_GET['xh']; $mail = $_GET['mail']; $sql = "select name from buser where name='{$name}'"; $sqli = "INSERT INTO buser (name,password,xh,mail) VALUES ('{$name}','{$pass}','{$xh}','{$mail}')"; $desql = "CREATE TABLE IF NOT EXISTS `{$mail}` (\n `Id` int(11) NOT NULL AUTO_INCREMENT,\n `title` varchar(255) DEFAULT NULL,\n `content` varchar(800) DEFAULT NULL,\n `time` varchar(25) DEFAULT NULL,\n PRIMARY KEY (`Id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n"; $te = new dblink(); if (count($te->dbquery($sql)) != 0) { echo 'fondsamename'; } else { if (is_array($te->dbquery($sqli))) { $te->dbquery($desql); echo 'ok'; } else { echo 'fail'; } }
<?php require 'dblink.php'; $name = $_POST['username']; $pass = $_POST['pass']; $xh = $_POST['xh']; $mail = $_POST['mail']; $sql = "select * from buser where name='{$name}'"; $sqli = "INSERT INTO buser (name,password,xh,mail) VALUES ('{$name}','{$pass}','{$xh}','{$mail}')"; $te = new dblink(); if (count($te->dbquery($sql)) == 1) { session_start(); $_SESSION['yz'] = 'fail'; echo $te->dbquery($sql); header("location:zc.php"); exit; } else { if (is_array($te->dbquery($sqli))) { ?> <script type="text/javascript"> alert("新增用户成功,欢迎你的加入哦!现在开始登录吧!");window.location.href="index.php"; </script> <?php } else { ?> <script type="text/javascript"> alert("未知错误!再试一下吧,还不行的话就快联系管理员吧!Simplesky:991605149@qq.com");window.location.href="zc.php"; </script> <?php } }
<?php require 'dblink.php'; $te = new dblink(); $tablename = date('y_m_d_H_i_s'); $name = $_POST['tname']; $sqlyz = "SELECT * FROM course where name='{$name}'"; $sqlj = "INSERT INTO course (name,tname) VALUES ('{$name}','{$tablename}')"; $sqlcreate = "CREATE TABLE {$tablename} (\n `Id` int(11) NOT NULL AUTO_INCREMENT,\n `name` varchar(255) DEFAULT NULL,\n `value` varchar(255) DEFAULT NULL,\n PRIMARY KEY (`Id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n"; if (count($te->dbquery($sqlyz)) == 0) { $te->dbquery($sqlj); $te->dbquery($sqlcreate); for ($i = 0; $i < 25; $i++) { $course = 'course' . $i; $values = $_POST[$course]; $sql = "INSERT INTO {$tablename} (name,value) VALUES ('{$course}','{$values}')"; if (is_array($te->dbquery($sql))) { //echo 1; } else { //echo 3; } } $sqlam = "insert into {$tablename} (name,value) values ('am','0')"; $sqlah = "insert into {$tablename} (name,value) values ('ah','14')"; $sqlmm = "insert into {$tablename} (name,value) values ('mm','15')"; $sqlmh = "insert into {$tablename} (name,value) values ('mh','8')"; $te->dbquery($sqlam); $te->dbquery($sqlah); $te->dbquery($sqlmm); $te->dbquery($sqlmh); echo '1';
</form> <p /> <div> <?php if (isset($_POST['xi'])) { switch ($_POST['xi']) { case 'yjs': $tablename .= 'yjs'; break; } $tablename .= $_POST['ji'] . $_POST['ban']; session_start(); $_SESSION['tablename'] = $tablename; require 'dblink.php'; $sql = "select name,value from {$tablename}"; $te = new dblink(); $re = $te->dbquery($sql); if (is_array($re)) { $ar = array(); for ($i = 0; $i < count($re); $i++) { $arr = $re[$i]; $ar[$arr['name']] = $arr['value']; } ?> <form action="cxxgserver.php" name="form1" method="post"> <table border="2px" style="border-color: #009900;"> <tr> <th>修改+</th> <th>星期一</th> <th>星期二</th>
<?php require 'dblink.php'; $sql = "select user,ms,time from plb order by Id asc"; $db = new dblink(); $pagecount = $_GET['page']; if ($_GET['page'] == "") { $page = 0; } $pagecount = 10; //=$pagecount*$_GET['page']; $a = $db->dbquery("select * from plb order by Id desc limit {$page},{$pagecount}"); for ($i = 0; $i < count($a); $i++) { echo '<p style="color: #ff3366;font-size:12px;">' . $a[$i]['user'] . '</p>'; echo '<p style="color:#000;font-size:12px;">' . $a[$i]['ms'] . '</p>'; echo '<p style="color:#999;font-size:10px;">' . $a[$i]['time'] . '</p>'; }
echo 'updatefail'; } } } else { echo 'nofound'; }*/ require 'dblink.php'; header("Content-Type: text/html; charset=utf-8"); $toaddress = $_GET['address']; $content = $_GET['content']; $newpass = $_GET['newpass']; $sql = "select mail from buser where mail='{$toaddress}'"; $nsql = "update buser set password='******' where mail='{$toaddress}'"; $te = new dblink(); $mail = new SaeMail(); $findconf = array('from' => '*****@*****.**', 'to' => $toaddress, 'smtp_host' => 'smtp.qq.com', 'smtp_port' => 25, 'smtp_username' => '*****@*****.**', 'smtp_password' => 'mail1993', 'subject' => '课程助手密码找回', 'content' => '<b>欢迎使用课程助手:</b><hr>你正在进行课程助手用户密码找回操作,验证码为:<font color="#ff0000">' . $content . '</font>,如非本人操作,那么你就可以忽略此邮件了啦。<br/><br/>课程助手<br/><a href="http://simplesky.sinaapp.com">http://simplesky.sinaapp.com</a>', 'content_type' => 'HTML', 'nickname' => '课程助手'); $updateconf = array('from' => '*****@*****.**', 'to' => $toaddress, 'smtp_host' => 'smtp.qq.com', 'smtp_port' => 25, 'smtp_username' => '*****@*****.**', 'smtp_password' => 'mail1993', 'subject' => '课程助手密码重置成功', 'content' => '<b>欢迎使用课程助手:</b><hr>你的课程助手用户密码已经成功重置了啦。<br/><br/>课程助手<br/><a href="http://simplesky.sinaapp.com">http://simplesky.sinaapp.com</a>', 'content_type' => 'HTML', 'nickname' => '课程助手'); if (count($te->dbquery($sql)) != 0) { if ($newpass == null) { $mail->setOpt($findconf); $re = $mail->send(); if (!$re) { echo 'fail'; } else { echo "ok"; } } else { if (is_array($te->dbquery($nsql))) { echo 'updateok';
private function open_db_table() { global $db_host; global $db_user; global $db_pass; global $db_name; if (!$table_) { $dblink = new dblink(); $dblink->connect($db_host, $db_user, $db_pass, $db_name); $this->table_ = new table($dblink, $this->table_name()); } }
<?php require 'dblink.php'; $userkey = $_GET['userkey']; $pass = $_GET['pass']; $type = $_GET['type']; $sqlname = "select * from buser where name='{$userkey}' and password='******'"; $sqlmail = "select * from buser where mail='{$userkey}' and password='******'"; $te = new dblink(); if ($type == 'name') { $re = $te->dbquery($sqlname); } else { if ($type == 'mail') { $re = $te->dbquery($sqlmail); } } if (count($re) == 0) { echo 'fail'; } else { $res = $re[0]; $result = array(); $ar['content'] = urlencode($arr['content']); $result['name'] = urlencode($res['name']); $result['mail'] = urlencode($res['mail']); $result['xh'] = urlencode($res['xh']); echo urldecode(json_encode($result)); }
<?php require 'dblink.php'; session_start(); date_default_timezone_set(PRC); //date_default_timezone_set('Asia/Shanghai') ; $ct = $_POST['ct']; $date = date("Y/m/d H:i:s"); if ($_REQUEST['user'] != '') { $user = $_GET['user'] . '使用安卓客户端'; } else { if ($_COOKIE['stunumber'] != '') { $user = $_COOKIE['stunumber'] . '使用浏览器'; } else { $user = time() . '使用浏览器'; } } $sqli = "INSERT INTO plb (user,ms,time) VALUES ('{$user}','{$ct}','{$date}')"; $te = new dblink(); if (is_array($te->dbquery($sqli))) { echo '<script type="text/javascript">window.location.href="suggestandbroadcast.php?user='******'user'] . '";</script>'; } else { ?> <script type="text/javascript"> alert("未知错误!,再试一下吧,还不行的话就快联系管理员吧!Simplesky:991605149@qq.com");window.location.href="suggestandbroadcast.php"; </script> <?php } ?>
//send the message, check for errors if (!$mail->send()) { echo 'fail'; } else { echo "ok"; } } else { echo 'foundsame'; }*/ require 'dblink.php'; header("Content-Type: text/html; charset=utf-8"); $toaddress = $_GET['address']; $content = $_GET['content']; $sql = "select mail from buser where mail='{$toaddress}'"; $te = new dblink(); $mail = new SaeMail(); if (count($te->dbquery($sql)) == 0) { $findconf = array('from' => '*****@*****.**', 'to' => $toaddress, 'smtp_host' => 'smtp.qq.com', 'smtp_port' => 25, 'smtp_username' => '*****@*****.**', 'smtp_password' => 'mail1993', 'subject' => '注册课程助手用户验证', 'content' => '<b>欢迎使用课程助手:</b><hr>你正在进行邮箱注册验证,验证码为:<font color="#ff0000">' . $content . '</font>,如非本人操作,那么你就可以忽略此邮件了啦。<br/><br/>课程助手<br/><a href="http://simplesky.sinaapp.com">http://simplesky.sinaapp.com</a>', 'content_type' => 'HTML', 'nickname' => '课程助手'); $mail->setOpt($findconf); if (!$mail->send()) { echo 'fail'; } else { echo "ok"; } } else { echo 'foundsame'; }
<?php require 'dblink.php'; $te = new dblink(); $user = $_GET['user']; $type = $_GET['type']; $title = $_GET['title']; $content = $_GET['content']; $date = $_GET['date']; $sqli = "INSERT INTO `{$user}` (title,content,time) VALUES ('{$title}','{$content}','{$date}')"; $sqlq = "TRUNCATE TABLE `{$user}`"; $sqlc = "SELECT * FROM `{$user}`"; if ($type == 'start') { if (is_array($te->dbquery($sqlq))) { echo 'ok'; } else { echo 'fail'; } } else { if ($type == 'up') { if (is_array($te->dbquery($sqli))) { echo 'ok'; } else { echo 'fail'; } } else { if ($type == 'down') { $re = $te->dbquery($sqlc); $ar = array(); for ($i = 0; $i < count($re); $i++) { $arr = $re[$i];
<?php require 'dblink.php'; $sql = "CREATE TABLE `course` (\n `Id` int(11) NOT NULL AUTO_INCREMENT,\n `name` varchar(255) DEFAULT NULL,\n `tname` varchar(255) DEFAULT NULL,\n PRIMARY KEY (`Id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; $te = new dblink(); if (is_array($re = $te->dbquery($sql))) { echo "install ok!"; } else { echo "install fail!"; }