本文整理汇总了PHP中_location函数的典型用法代码示例。如果您正苦于以下问题:PHP _location函数的具体用法?PHP _location怎么用?PHP _location使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_location函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _unsetcookies
/**
*
*/
function _unsetcookies()
{
setcookie('username', '', time() - 1);
setcookie('uniqid', '', time() - 1);
_session_destroy();
_location(null, 'index.php');
}
示例2: _login_state
/**
* _login_state判断登录状态和权限
* @param $level 当前页面所需要最低权限
*/
function _login_state($level)
{
if (!$_SESSION['num'] || !$_SESSION['username']) {
_location("请先登录!", "login.php");
}
if ($level > $_SESSION['level']) {
_alert_back("权限不足!");
}
}
示例3: define
<?php
/**
* Guest Version1.0
* ================================================
* Copy 2015-2016 hikobe8
* Email: hikobe8@163.com
* ================================================
* Author: hikobe8
* Date:2015年12月17日下午9:17:14
*/
// 定义防止恶意调用使用的常量
define("IN_TG", true);
// 引入公共文件
require dirname(__FILE__) . '/includes/common.inc.php';
//打开session
session_start();
_logout();
_location(null, "index.php");
示例4: dirname
require dirname(__FILE__) . '/includes/common.inc.php';
//判断是否登录
if (!isset($_COOKIE['username'])) {
_alert_back('请先登录!');
}
//批删除花朵
if ($_GET['action'] == 'delete' && isset($_POST['ids'])) {
$_clean = array();
$_clean['ids'] = _mysql_string(implode(',', $_POST['ids']));
//为了防止cookies伪造,还要比对一下唯一标识符uniqid()
if (!!($_rows = _fetch_array("SELECT\n tg_uniqid\n FROM\n tg_user\n WHERE\n tg_username='{$_COOKIE['username']}'\n LIMIT\n 1"))) {
_uniqid($_rows['tg_uniqid'], $_COOKIE['uniqid']);
_query("DELETE FROM\n\t tg_flower\n\t WHERE\n\t tg_id\n\t IN\n\t ({$_clean['ids']})");
if (_affected_rows()) {
_close();
_location('花朵删除成功', 'member_flower.php');
} else {
_close();
_alert_back('花朵删除失败');
}
} else {
_alert_back('非法登录');
}
}
//分页模块
global $_pagesize, $_pagenum;
_page("SELECT tg_id FROM tg_flower WHERE tg_touser='{$_COOKIE['username']}'", 15);
//第一个参数获取总条数,第二个参数,指定每页多少条
$_result = _query("SELECT\n tg_id,tg_fromuser,tg_flower,tg_content,tg_date\n FROM\n tg_flower\n WHERE\n tg_touser='{$_COOKIE['username']}'\n ORDER BY\n tg_date DESC\n LIMIT\n {$_pagenum},{$_pagesize}\n ");
?>
示例5: _location
}
}
}
if (!_query("UPDATE gm_teacher SET gm_student='{$students_e}' WHERE gm_username='{$r_s['gm_teacher']}' LIMIT 1")) {
_location("更新导师信息表时出错!", "user_data.php");
}
}
$photoname = "photos" . $r_s['gm_photoname'];
chmod($photoname, 0777);
unlink($photoname);
if (!_query("DELETE FROM gm_stuinfo WHERE gm_num='{$_GET['num']}'") or !_query("DELETE FROM gm_user WHERE gm_num='{$_GET['num']}'")) {
_location('从学生表或用户表中删除数据时失败!!', 'user_data.php');
}
_location('删除成功!', 'user_data.php');
} else {
_location('未找到你要删除的数据!', 'user_data.php');
}
}
?>
<!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" />
<?php
require ROOT_PATH . 'includes/title_admin.inc.php';
?>
<script type="text/javascript" src="js/sortable-table.js"></script>
</head>
<body>
<?php
示例6: _uniqid
if (isset($_GET['action']) && $_GET['action'] == 'addimg') {
if (!!($_rows = _fetch_array("SELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_uniqid\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_user \n\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_username='{$_COOKIE['username']}' \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t LIMIT 1"))) {
_uniqid($_rows['tg_uniqid'], $_COOKIE['uniqid']);
include 'includes/check.func.php';
//receive data
$_clean = array();
$_clean['name'] = _check_dir_name($_POST['name']);
$_clean['url'] = _check_photo_url($_POST['url']);
$_clean['content'] = $_POST['content'];
$_clean['sid'] = $_POST['sid'];
$_clean = _mysql_string($_clean);
//write into database
_query("INSERT INTO tg_photo (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_content,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_sid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_username,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_date\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\t\t\t\t\t\tVALUES (\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['name']}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['url']}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['content']}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['sid']}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_COOKIE['username']}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tNOW()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)");
if (_affected_rows() == 1) {
_close();
_location('Successfully uploaded', 'photo_show.php?id=' . $_clean['sid']);
} else {
_close();
_alert_back('Fail to upload');
}
} else {
_alert_back('Illegal access');
}
}
//receive id
if (isset($_GET['id'])) {
if (!!($_rows = _fetch_array("SELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_dir\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_dir\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id='{$_GET['id']}'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1\n\t"))) {
$_html = array();
$_html['id'] = $_rows['tg_id'];
$_html['dir'] = $_rows['tg_dir'];
$_html = _html($_html);
示例7: _check_code
_check_code($_POST['code'], $_SESSION['code']);
if (!!($_rows = _fetch_array("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_uniqid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_user \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_username='{$_COOKIE['username']}' \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t LIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1"))) {
_uniqid($_rows['tg_uniqid'], $_COOKIE['uniqid']);
//接受数据
$_clean = array();
$_clean['sid'] = $_POST['sid'];
$_clean['title'] = $_POST['title'];
$_clean['content'] = $_POST['content'];
$_clean['username'] = $_COOKIE['username'];
$_clean = _mysql_string($_clean);
//写入数据库
_query("INSERT INTO tg_photo_commend (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_sid,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_username,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_title,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_content,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_date\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t VALUES (\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t'{$_clean['sid']}',\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t'{$_clean['username']}',\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t'{$_clean['title']}',\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t'{$_clean['content']}',\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\tNOW()\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t)");
if (_affected_rows() == 1) {
_query("UPDATE tg_photo SET tg_commendcount=tg_commendcount+1 WHERE tg_id='{$_clean['sid']}'");
_close();
_location('评论成功!', 'photo_detail.php?id=' . $_clean['sid']);
} else {
_close();
_alert_back('评论失败!');
}
} else {
_alert_back('非法登录!');
}
}
//取值
if (isset($_GET['id'])) {
if (!!($_rows = _fetch_array("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_name,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_sid,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_url,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_username,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_readcount,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_commendcount,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_content,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_date\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_photo\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id='{$_GET['id']}'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1\r\n\t"))) {
//防止加密相册图片穿插访问
//可以先取得这个图片的sid,也就是它的目录,
//然后再判断这个目录是否是加密的,
//如果是加密的,再判断是否有对应的cookie存在,并且对于相应的值
示例8: _uniqid
//为了防止cookie伪造,还要比对一下唯一标示符uniqid()
_uniqid($_rows['tg_uniqid'], $_COOKIE['uniqid']);
//开始修改
include ROOT_PATH . 'includes/check.func.php';
$_clean = array();
$_clean['id'] = $_POST['id'];
$_clean['type'] = $_POST['type'];
$_clean['title'] = _check_post_title($_POST['title'], 2, 40);
$_clean['content'] = _check_post_content($_POST['content'], 10);
$_clean = _mysql_string($_clean);
//执行sql
_query("update tg_article set \n\t\t\t\t\t\t\t\t\t\ttg_type='{$_clean['type']}',\n\t\t\t\t\t\t\t\t\t\ttg_title='{$_clean['title']}',\n\t\t\t\t\t\t\t\t\t\ttg_content='{$_clean['content']}',\n\t\t\t\t\t\t\t\t\t\ttg_last_modify_date=NOW()\n\t\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\t\ttg_id='{$_clean['id']}'\n\t\t\t\t\t\t\t\t");
if (_affected_rows() == 1) {
_close();
//_session_destroy();
_location('帖子修改成功', 'article.php?id=' . $_clean['id']);
} else {
_close();
//_session_destroy();
_alert_back('帖子修改失败');
}
} else {
_alert_back('非法登录');
}
}
//读取数据
if (isset($_GET['id'])) {
if (!!($_rows = _fetch_array("select \n\t\t\t\t\t\t\t\t\t\ttg_username,tg_title,tg_type,tg_content\n\t\t\t\t\t\t\t\t\tfrom \n\t\t\t\t\t\t\t\t\t\ttg_article \n\t\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\t\ttg_reid=0\n\t\t\t\t\t\t\t\t\tand \n\t\t\t\t\t\t\t\t\t\ttg_id='{$_GET['id']}'"))) {
$_html = array();
$_html['id'] = $_GET['id'];
$_html['username'] = $_rows['tg_username'];
示例9: _mysql_string
$_clean['type'] = $_POST['type'];
$_clean['title'] = $_POST['title'];
$_clean['content'] = $_POST['content'];
$_clean['username'] = $_COOKIE['username'];
$_clean = _mysql_string($_clean);
//写入数据库
_query("insert into tg_article(\n\t\t\t\t\t\t\t\t\t\ttg_reid,\n\t\t\t\t\t\t\t\t\t\ttg_username,\n\t\t\t\t\t\t\t\t\t\ttg_title,\n\t\t\t\t\t\t\t\t\t\ttg_type,\n\t\t\t\t\t\t\t\t\t\ttg_content,\n\t\t\t\t\t\t\t\t\t\ttg_date\n\t\t\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\t\t\tvalues(\n\t\t\t\t\t\t\t\t\t\t'{$_clean['reid']}',\n\t\t\t\t\t\t\t\t\t\t'{$_clean['username']}',\n\t\t\t\t\t\t\t\t\t\t'{$_clean['title']}',\n\t\t\t\t\t\t\t\t\t\t'{$_clean['type']}',\n\t\t\t\t\t\t\t\t\t\t'{$_clean['content']}',\n\t\t\t\t\t\t\t\t\t\tNOW()\n\t\t\t\t\t\t\t\t\t\t)");
if (_affected_rows() == 1) {
//setcookie('article_time',time()); //设置当前回帖时间
//设置回帖的时间戳
$_clean['time'] = time();
_query("update tg_user set tg_article_time='{$_clean['time']}' where tg_username='{$_COOKIE['username']}'");
_query("update tg_article set tg_commentcount=tg_commentcount+1 where tg_reid=0 and tg_id='{$_clean['reid']}'");
_close();
//_session_destroy();
_location('回帖成功', 'article.php?id=' . $_clean['reid']);
} else {
_close();
//_session_destroy();
_alert_back('回帖失败');
}
} else {
_alert_back('非法登录');
}
}
//读出数据
if (isset($_GET['id'])) {
//判断这个id在数据库中是否存在
if (!!($_rows = _fetch_array("select \n\t\t\t\t\t\t\t\t\t\ttg_id,\n\t\t\t\t\t\t\t\t\t\ttg_username,\n\t\t\t\t\t\t\t\t\t\ttg_title,\n\t\t\t\t\t\t\t\t\t\ttg_type,\n\t\t\t\t\t\t\t\t\t\ttg_content,\n\t\t\t\t\t\t\t\t\t\ttg_readcount,\n\t\t\t\t\t\t\t\t\t\ttg_commentcount,\n\t\t\t\t\t\t\t\t\t\ttg_last_modify_date,\n\t\t\t\t\t\t\t\t\t\ttg_nice,\n\t\t\t\t\t\t\t\t\t\ttg_date \n\t\t\t\t\t\t\t\t\tfrom \n\t\t\t\t\t\t\t\t\t\ttg_article \n\t\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\t\ttg_reid=0\n\t\t\t\t\t\t\t\t\tand \n\t\t\t\t\t\t\t\t\t\ttg_id='{$_GET['id']}'"))) {
$_html = array();
$_html['reid'] = $_rows['tg_id'];
示例10: mkdir
mkdir('photo', 0777);
}
//再在这个主目录里面创建你定义的相册目录
if (!is_dir('photo/' . $_clean['dir'])) {
mkdir('photo/' . $_clean['dir']);
}
//把当前的目录信息写入数据库即可
if (empty($_clean['type'])) {
_query("INSERT INTO tg_dir (\n\t\t tg_name,\n\t\t tg_type,\n\t\t tg_content,\n\t\t tg_dir,\n\t\t tg_date\n\t\t )\n\t\t VALUES (\n\t\t '{$_clean['name']}',\n\t\t '{$_clean['type']}',\n\t\t '{$_clean['content']}',\n\t\t 'photo/{$_clean['dir']}',\n\t\t NOW()\n\t\t )");
} else {
_query("INSERT INTO tg_dir (\n\t\t tg_name,\n\t\t tg_type,\n\t\t tg_content,\n\t\t tg_dir,\n\t\t tg_date,\n\t\t tg_password\n\t\t )\n\t\t VALUES (\n\t\t '{$_clean['name']}',\n\t\t '{$_clean['type']}',\n\t\t '{$_clean['content']}',\n\t\t 'photo/{$_clean['dir']}',\n\t\t NOW(),\n\t\t\t\t\t'{$_clean['password']}'\n\t\t\t\t\t)");
}
//目录添加成功
if (_affected_rows() == 1) {
_close();
_location('目录添加成功', 'photo.php');
} else {
_close();
_alert_back('目录添加失败!');
}
} else {
_alert_back('非法登录!');
}
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<?php
示例11: _query
//新增用户
_query("INSERT INTO gu_user(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_uniqid,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_active,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_username,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_password,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_question,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_answer,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_sex,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_face,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_email,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_qq,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_reg_time,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_last_time,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgu_last_ip\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['uniqid']}',\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['active']}',\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['username']}',\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['password']}',\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['question']}',\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['answer']}',\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['sex']}',\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['face']}',\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['email']}',\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_clean['qq']}',\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tNOW(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{$_SERVER['REMOTE_ADDR']}'\t\t\t\t\t\t\t\t\n\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t)");
if (_affected_rows() == 1) {
//关闭
_close();
//销毁session
_session_destroy();
//跳转
_location('恭喜你!注册成功!', 'active.php?active=' . $_clean['active']);
} else {
//关闭
_close();
//销毁session
_session_destroy();
//跳转
_location('很遗憾!由于未知原因注册失败!', 'register.php');
}
} else {
$_SESSION['uniqid'] = $_uniqid = _sha1_uniqid();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xlmns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charst=utf-8" />
<?php
require ROOT_PATH . 'includes/title.inc.php';
?>
<script type="text/javascript" src="js/code.js"></script>
<script type="text/javascript" src="js/register.js"></script>
<title>一个论坛----注册</title>
示例12: array
}
//取值
if (isset($_GET['id'])) {
if (!!($_rows = _fetch_array("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id,tg_name,tg_type\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_dir\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id='{$_GET['id']}'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1\r\n\t"))) {
$_dirhtml = array();
$_dirhtml['id'] = $_rows['tg_id'];
$_dirhtml['name'] = $_rows['tg_name'];
$_dirhtml['type'] = $_rows['tg_type'];
$_dirhtml = _html($_dirhtml);
//对比加密相册的验证信息
if ($_POST['password']) {
if (!!($_rows = _fetch_array("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_dir\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_password='" . sha1($_POST['password']) . "'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1\r\n\t\t\t"))) {
//生成cookie
setcookie('photo' . $_dirhtml['id'], $_dirhtml['name']);
//重定向
_location(null, 'photo_show.php?id=' . $_dirhtml['id']);
} else {
_alert_back('相册密码不正确!');
}
}
} else {
_alert_back('不存在此相册!');
}
} else {
_alert_back('非法操作!');
}
$_percent = 0.3;
global $_pagesize, $_pagenum, $_system, $_id;
$_id = 'id=' . $_dirhtml['id'] . '&';
_page("SELECT tg_id FROM tg_photo WHERE tg_sid='{$_dirhtml['id']}'", $_system['photo']);
$_result = _query("SELECT \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_id,tg_username,tg_name,tg_url,tg_readcount,tg_commendcount \r\n\t\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_photo \r\n\t\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_sid='{$_dirhtml['id']}'\r\n\t\t\t\t\t\t\tORDER BY \r\n\t\t\t\t\t\t\t\t\t\t\t\ttg_date DESC \r\n\t\t\t\t\t\t\t\t\t LIMIT \r\n\t\t\t\t\t\t\t\t\t\t\t\t{$_pagenum},{$_pagesize}\r\n\t\t\t\t\t\t\t");
示例13: define
/**
*2012-8-22 | By:NaV!
*/
//防止恶意调用
define('IN_GM', true);
//定义个常量,用来指定本页的内容
define('SCRIPT', 'message_add_s');
//引入公共文件
require dirname(__FILE__) . '/includes/common.inc.php';
//判断登录状态和权限
_login_state(1);
if ($_POST['submit'] == "提 交") {
include ROOT_PATH . 'includes/register.func.php';
$content = _check_content($_POST['content']);
if (_query("INSERT INTO gm_message(gm_username,gm_num,gm_content,gm_systime)\r\n\t\tVALUES('{$_SESSION['username']}','{$_SESSION['num']}','{$content}',NOW())") or die(mysql_error())) {
_location("发布成功!", "message_s.php");
} else {
_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" />
<?php
require ROOT_PATH . 'includes/title_student.inc.php';
?>
</head>
<body>
示例14: _uniqid
if (!!($_rows = _fetch_array("SELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_uniqid \n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_user \n\t\t\t\t\t\t\t\t\t\t\t\t WHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_username='{$_COOKIE['username']}' \n\t\t\t\t\t\t\t\t\t\t\t\t\t LIMIT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1"))) {
_uniqid($_rows['tg_uniqid'], $_COOKIE['uniqid']);
//begin modifying
include ROOT_PATH . 'includes/check.func.php';
$_clean = array();
$_clean['id'] = $_POST['id'];
$_clean['type'] = $_POST['type'];
$_clean['title'] = _check_post_title($_POST['title'], 2, 40);
$_clean['content'] = _check_post_content($_POST['content'], 10);
$_clean = _mysql_string($_clean);
//execute SQL
_query("UPDATE tg_article SET \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_type='{$_clean['type']}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_title='{$_clean['title']}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_content='{$_clean['content']}',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_last_modify_date=NOW()\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id='{$_clean['id']}'\n\t\t");
if (_affected_rows() == 1) {
_close();
//_session_destroy();
_location('Successfully modified!', 'article.php?id=' . $_clean['id']);
} else {
_close();
//_session_destroy();
_alert_back('Fail to modify');
}
} else {
_alert_back('Illegal access');
}
}
//¶ÁÈ¡Êý¾Ý
if (isset($_GET['id'])) {
if (!!($_rows = _fetch_array("SELECT \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_username,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_title,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_content\n\t\t\t\t\t\t\t\t\t\t\t\t\t FROM \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_article \n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_reid=0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttg_id='{$_GET['id']}'"))) {
$_html = array();
$_html['id'] = $_GET['id'];
$_html['username'] = $_rows['tg_username'];
示例15: session_start
/*
* 找回密码
* 发送邮件
*/
session_start();
error_reporting(0);
header("Content-Type:text/html; charset=UTF-8");
require 'common.inc.php';
require 'login.inc.php';
require 'stmp.class.php';
$_data['email'] = $_POST['email'];
$pass = DB_PRE . 'ask_user';
$_sql = "SELECT * FROM {$pass} where email='{$_data['email']}'";
if ($re = _fetch_array($_sql)) {
/*
*
*/
$smtpemailto = $_data['email'];
$mailsubject = "message from lzu_ask ";
$newpassword = rand(100000, 999999);
$pa = "你的密码是";
$mailbody = '尊敬的' . $re['username'] . '用户' . $pa . $newpassword . '请马上修改您的密码!';
send_email($smtpemailto, $mailsubject, $mailbody);
$newpassword = sha1($newpassword);
$sql = "UPDATE {$pass} SET password='{$newpassword}' WHERE email='{$_data['email']}'";
_query($sql);
_location("请查收邮件", "blank.php");
} else {
_alert_back("该邮箱不存在");
}