public static function loginsession($username){ $info = operate::getoneline("member","username='******'"); $_SESSION['username']=$info['username']; $_SESSION['id']=$info['id']; $_SESSION['qq']=$info['qq']; $_SESSION['phone']=$info['phone']; $_SESSION['Email']=$info['Email']; }
<?php include './conn/comment.php'; if (isset($_GET['ac'])) { if ($_GET['ac'] == "logout") { session_unset(); $errtime = "3"; $errurl = "/"; $errcon = "退出成功"; include './tpl/succ.tpl'; } if ($_GET['ac'] == "login") { if ($loginfo = operate::getoneline('member', 'username="******" or email="' . $_POST['username'] . '"', 'id,password')) { if ($_POST['password'] == $loginfo['password']) { operate::login($loginfo['id']); $errtime = 3; $errurl = "/"; $errcon = "登录成功!"; include "./tpl/succ.tpl"; } else { $errcon = "密码错误,请重试"; include "./tpl/err.tpl"; } } else { $errtime = 3; $errcon = "不存在该用户!"; include "./tpl/err.tpl"; } } $PATH = "./tpl/" . $_GET['ac'] . '.tpl'; if (file_exists($PATH)) {
<?php //入口 目录+文件 include './conn/comment.php'; if (!$login) { $errtime = 3; $errcon = "请先登陆!"; $errurl = "/action.php?ac=logininfo"; include "./tpl/err.tpl"; } if (isset($_GET['db'])) { $_GET['db'] += 0; $table = operate::getoneline('materialtable', 'id=' . $_GET['db'] . ' and uid=' . $login); if (!$table) { $errcon = "不存在该表"; include "./tpl/err.tpl"; } if (isset($_POST['add'])) { //添加 $filed = array(); foreach ($_POST as $key => $value) { if ($key != "add" && $key != "t1") { $filed[] = $value; } } $info = serialize($filed); operate::insertoneline('material', array('mid', 'title', 'info'), array($_GET['db'], $_POST['t1'], $info)); $errcon = "添加成功"; include "./tpl/succ.tpl"; } if (isset($_POST['edit'])) {
<?php error_reporting(0); define("ACCESS", 1); session_start(); include "./conn/conn.php"; include "./conn/operater.php"; if (isset($_SESSION['userid'])) { $login = $_SESSION['userid']; $user = operate::getoneline('member', 'id=' . $_SESSION['userid']); } else { $login = 0; }
<?php header("Content-type: text/html;charset=utf-8"); $pid = $_GET['pid']; define('ACCESS', '1'); include '../conn/connect.php'; include '../conn/operate.php'; $sql = "select id,city from city where parentid={$pid}"; $result = mysql_query($sql); $i = 0; while ($rows = mysql_fetch_array($result)) { $i++; echo "<option value=" . $rows['0'] . ">"; echo $rows['1']; echo "</option>"; } if ($i == 0) { $cityone = operate::getoneline('city', 'id=' . $pid, 'city'); echo "<option value=" . $pid . ">{$cityone['0']}</option>"; } ?>
if (!$login) { $errtime = 3; $errcon = "请先登陆!"; $errurl = "/action.php?ac=logininfo"; include "./tpl/err.tpl"; } if (!isset($_GET['id'])) { exit; } $_GET['id'] += 0; $info = operate::getoneline('material', 'id=' . $_GET['id']); if (!$info) { $errcon = "不存在信息"; include "./tpl/err.tpl"; } $table = operate::getoneline('materialtable', 'id=' . $info['mid'] . ' and uid=' . $login); if (!$table) { $errcon = "不存在该表"; include "./tpl/err.tpl"; } $content = unserialize($table['info']); $edit = unserialize($info['info']); ?> <section class="panel panel-default" style="margin-left:15%;width:70%;margin-top:5%"> <header class="panel-heading font-bold">编辑数据</header> <div class="panel-body"> <form class="bs-example form-horizontal" method="POST"> <?php $i = 1; foreach ($content as $item) { echo '<div class="form-group"><label class="col-lg-2 control-label">' . $item . '</label><div class="col-lg-10"><input type="text" class="form-control" name="t' . $i . '" value="';
mkdir($path); } if (move_uploaded_file($tempFile, $path . $fileName)) { $pic = $fileName; } else { //上传失败 } } //API存储信息 $city = $_POST['select2']; $cityone = operate::getoneline('city', 'id=' . $city, 'parentid,city'); $adress; if ($cityone[0] == 0) { $adress = $cityone[1] . $_POST['address']; } else { $citytwo = operate::getoneline('city', 'id=' . $cityone[0], 'city'); $adress = $citytwo[0] . $cityone[1] . $_POST['address']; } operate::insertoneline('item', array('title', 'pic', 'class', 'money', 'deposit', 'seller', 'content', 'city', 'address'), array($_POST['title'], $pic, $_POST['class'], $_POST['money'], $_POST['deposit'], $_SESSION['id'], $_POST['content'], $city, $_POST['address'])); $temp = mysql_fetch_row(mysql_query('select id from item order by id desc limit 1')); @($post_string = "key=ba8a19891a7cb1bc3e2f3411d01d9035&tableid=548fbe84e4b0d0b861454b2c&loctype=2&data={'_name'='" . $_POST['title'] . "','_address'='" . $adress . "','img'='" . $pic . "','id'='" . $temp[0] . "','money'='" . $_POST['money'] . "'}"); operate::file_get_contents_post('http://yuntuapi.amap.com/datamanage/data/create', $post_string); $errurl = "member.php?act=myrenting"; $errinfo = "恭喜您,发布成功!"; include 'templete/err.html'; } } } ?> <html> <head>
.input-group label{padding:2% 0;position:absolute;color:#595757} .input-group input{margin-left:10em;padding:3% 5% ;box-sizing:border-box;background:#efeff0;border:0;border-radius:5px;color:#595757;width:100%} .odform button{ background:#CC0000 ;color:#00FF00;text-align:center;border:0;border-radius:10px;padding:3%;width:100%;font-size:16px} .odform .cal{background-image:url(style/images/daetixian-cal.png);background-repeat:no-repeat;background-position:95% center;background-size:auto 50%} .odform .xl{background-image:url(style/images/daetixian-xl.png);background-repeat:no-repeat;background-position:95% center;background-size:auto 20%} </style> <?php $id = $_GET['id']; // echo $id; $userinfo = operate::getoneline("member", "username='******'username'] . "'"); $iteminfo = operate::getoneline("crafts", "id={$id}"); include "templete/header.html"; // echo $iteminfo['type']; // echo $userinfo['qq']; ?> <div class="blank"></div> <div class="module fl wfs"> <div class="cover-page-details fl wfs bcf2"> <div class="cover-page-wrapper"> <div class="place fz12" style="padding-left:20px;"> <a href=".">主页</a> <code>></code> <a href="#"><?php echo $iteminfo['type']; ?> </a> <code>></code> <?php echo $iteminfo['name'];
<html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <title>标题 - Handicrafts</title> <?php include 'templete\\header.html'; define('ACCESS', '1'); // session_start(); include 'conn/connect.php'; include 'conn/operate.php'; $id = $_GET['id']; $iteminfo[] = operate::getmuchlinesql("`groupchou`", "where id={$id}"); if (isset($_GET['id']) && isset($_GET['money'])) { $id = $_GET['id']; $item = operate::getoneline("`groupchou`", "id={$id}"); // echo var_dump($item); $item['hasChou'] = $item['hasChou'] + $_GET['money']; $item['participate_num'] = $item['participate_num'] + 1; $money = $_GET['money']; $user = $_SESSION['username']; echo $money; $judge = 1; if (floor($judge) != $judge || $money <= 0) { $judge = 0; } echo 'judge = ' . $judge; if ($judge == 0) { ?> <script> alert('请输入合理的金额!');
<?php //入口 目录+文件 include './conn/comment.php'; if (!isset($_GET['id'])) { $errcon = "网址有误,请确定后重试"; include "./tpl/err.tpl"; } $_GET['id'] += 0; $table = operate::getoneline('materialtable', 'id=' . $_GET['id']); $content = unserialize($table['info']); if (!$table) { $errcon = "不存在该表"; include "./tpl/err.tpl"; } include "./tpl/materials.tpl";