//开始处理url路由,支持APP二级域名 if ($TS_CF['subdomain']) { ini_set("session.cookie_domain", '.' . $TS_CF['subdomain']['domain']); //APP独立域名支持 if (array_search($_SERVER['HTTP_HOST'], $TS_CF['appdomain'])) { reurlsubdomain(); } else { $arrHost = explode('.', $_SERVER['HTTP_HOST']); if ($arrHost[0] == 'www') { reurl(); } else { reurlsubdomain(); } } } else { reurl(); } //判断magic_quotes_gpc状态 if (get_magic_quotes_gpc() == 0) { $_GET = tsgpc($_GET); $_POST = tsgpc($_POST); $_COOKIE = tsgpc($_COOKIE); //$_FILES = tsgpc ( $_FILES ); } //系统Url参数变量 $TS_URL = array('app' => isset($_GET['app']) ? tsUrlCheck($_GET['app']) : 'home', 'ac' => isset($_GET['ac']) ? tsUrlCheck($_GET['ac']) : 'index', 'ts' => isset($_GET['ts']) ? tsUrlCheck($_GET['ts']) : '', 'mg' => isset($_GET['mg']) ? tsUrlCheck($_GET['mg']) : 'index', 'my' => isset($_GET['my']) ? tsUrlCheck($_GET['my']) : 'index', 'api' => isset($_GET['api']) ? tsUrlCheck($_GET['api']) : 'index', 'plugin' => isset($_GET['plugin']) ? tsUrlCheck($_GET['plugin']) : '', 'in' => isset($_GET['in']) ? tsUrlCheck($_GET['in']) : '', 'tp' => isset($_GET['tp']) ? tsUrlCheck($_GET['tp']) : '1', 'page' => isset($_GET['page']) ? tsUrlCheck($_GET['page']) : '1'); //下面是过渡,直到把所有的参数都改完 $app = $TS_URL['app']; $ac = $TS_URL['ac']; $ts = $TS_URL['ts']; $mg = $TS_URL['mg'];
<?php include("config.php"); if($_COOKIE[ "username"]=="") reurl('login.html'); echo "欢迎回来,".$_COOKIE[ "username"].".<br/>" ?> <a href="logout.php">退出</a>
<?php if( $_POST['title']=="") { reurl('add_order.html'); } include("menu.php"); $title =$_POST['title']; $info =$_POST['info']; $lowprice=$_POST['lowprice']; $stmt =$db->prepare("insert into orders (title,info,lowprice) values (:title,:info,:lowprice)"); $stmt->bindValue(':title',$title); $stmt->bindValue(':info',$info); $stmt->bindValue(':lowprice',$lowprice); $result=$stmt->execute(); if($result>0) alert_and_reurl('发布成功','orders.php'); reurl('add_order.html'); ?>
<?php if( $_POST['username']=="") { reurl('reg.html'); } include("config.php"); $username =$_POST['username']; $password =$_POST['password']; $email =$_POST['email']; $company =$_POST['company']; $tel =$_POST['tel']; $address =$_POST['address']; $info =$_POST['info']; $user_query=$db->prepare("select username from suppliers where username=:username"); $user_query->bindValue(':username',$username); $user=$user_query->execute(); $data=$user_query->fetch(); if(count($data)>1) alert_back('用户名被使用'); $stmt =$db->prepare("INSERT INTO suppliers (username , password , email , company , tel , address ,