flower.php,flower.php
session_start();
//定義個常量,用來授權調用includes里面的文件
define('IN_TG','flower');
define('IN_JS','flower');
//定義個常量,用來指定本頁的內容
define('SCRIPT','message');
//引入公共文件
require dirname(__FILE__).'/includes/common.inc.php';
//判斷是否登錄了
if(empty($_COOKIE['username'])){
_alert_close('請先登錄');
}
//送花
if(isset($_GET['action']))
{
if ($_GET['action'] == 'send') {
//驗證碼驗證
_check_code($_POST['code'],$_SESSION['code']);
//傳遞過來了數據中的內容是否為空
if (strlen($_POST['content']) == 0) {
_alert_back("內容不能為空!");
}
$sql="SELECT tg_uniqid FROM tg_user WHERE tg_username='{$_SESSION['username']}' LIMIT 1";
if (!!$_rows = _fetch_array($sql))
{
_uniqid($_rows['tg_uniqid'],$_COOKIE['uniqid']);
}
//引入文件
include ROOT_PATH.'includes/check.func.php';
$_clean = array();
$_clean['touser'] = $_POST['touser'];
$_clean['flower'] = $_POST['flower'];
$_clean['fromuser'] = $_SESSION['username'];
$_clean['content'] = _check_content($_POST['content']);
$_clean = _mysql_string($_clean);
//不能添加自己
if ($_clean['touser'] == $_clean['fromuser']) {
_alert_close('請不要為自己送花!');
}
//為好友送花
_query("INSERT INTO tg_flower (
tg_touser,
tg_fromuser,
tg_content,
tg_date,
tg_flower
)
VALUES (
'{$_clean['touser']}',
'{$_clean['fromuser']}',
'{$_clean['content']}',
NOW(),
'{$_clean['flower']}'
)
");
if (_affected_rows() == 1) {
_close();
//_session_destroy();
_alert_close('好友送花成功!');
} else {
_close();
//_session_destroy();
_alert_back('好友送花失敗!');
}
}
}
//獲取數據
if (isset($_GET['id'])) {
$sql="SELECT tg_username FROM tg_user WHERE tg_id='{$_GET['id']}' LIMIT 1 ";
if (!!$_rows = _fetch_array($sql))
{
$_html = array();
$_html['touser'] = $_rows['tg_username'];
$_html = _html($_html);
} else {
_alert_close('不存在此用戶!');
}
} else {
_alert_close('非法操作!');
}
?>
require ROOT_PATH.'includes/title.inc.php';
?>
送花
foreach (range(1,100) as $value):?>
<?php echo $value;?>朵
?>
總結
以上是生活随笔為你收集整理的flower.php,flower.php的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php ci model条件查询,Lar
- 下一篇: DNF魔道学者堆独立还是堆属强?