代码拉取完成,页面将自动刷新
同步操作将从 罗培中开发空间/php_study 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
/**
* TestGuest Version1.0
* ================================================
* Copy 2019-2021 ljcollege
* Web: http://www.ljcollege.com
* ================================================
* Author: Luo
* Date: 2020-9-8
*/
session_start();
//定义个常量,用来授权调用includes里面的文件
define('IN_TG',true);
//定义个常量,用来指定本页的内容
define('SCRIPT','flower');
//引入公共文件
require dirname(__FILE__).'/includes/common.inc.php';
//判断是否登录了
if (!isset($_COOKIE['username'])) {
_alert_close('请先登录!');
}
//送花
if ($_GET['action'] == 'send') {
_check_code($_POST['code'],$_SESSION['code']);
if (!!$_rows = _fetch_array("SELECT
tg_uniqid
FROM
tg_user
WHERE
tg_username='{$_COOKIE['username']}'
LIMIT
1
")) {
_uniqid($_rows['tg_uniqid'],$_COOKIE['uniqid']);
include ROOT_PATH.'includes/check.func.php';
$_clean = array();
$_clean['touser'] = $_POST['touser'];
$_clean['fromuser'] = $_COOKIE['username'];
$_clean['flower'] = $_POST['flower'];
$_clean['content'] = _check_content($_POST['content']);
$_clean = _mysql_string($_clean);
//写入表
_query("INSERT INTO tg_flower (
tg_touser,
tg_fromuser,
tg_flower,
tg_content,
tg_date
)
VALUES (
'{$_clean['touser']}',
'{$_clean['fromuser']}',
'{$_clean['flower']}',
'{$_clean['content']}',
NOW()
)
");
//新增成功
if (_affected_rows() == 1) {
_close();
//_session_destroy();
_alert_close('送花成功');
} else {
_close();
//_session_destroy();
_alert_back('送花失败');
}
} else {
_alert_close('非法登录!');
}
}
//获取数据
if (isset($_GET['id'])) {
if (!!$_rows = _fetch_array("SELECT tg_username FROM tg_user WHERE tg_id='{$_GET['id']}' LIMIT 1")) {
$_html = array();
$_html['touser'] = $_rows['tg_username'];
$_html = _html($_html);
} else {
_alert_close('不存在此用户!');
}
} else {
_alert_close('非法操作!');
}
?>
<!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.inc.php';
?>
<script type="text/javascript" src="js/code.js"></script>
<script type="text/javascript" src="js/message.js"></script>
</head>
<body>
<div id="message">
<h3>送花</h3>
<form method="post" action="?action=send">
<input type="hidden" name="touser" value="<?php echo $_html['touser']?>" />
<dl>
<dd>
<input type="text" readonly="readonly" value="TO:<?php echo $_html['touser']?>" class="text" />
<select name="flower">
<?php
foreach (range(1,100) as $_num) {
echo '<option value="'.$_num.'"> x'.$_num.'朵</option>';
}
?>
</select>
</dd>
<dd><textarea name="content">灰常欣赏你,送你花啦~~~</textarea></dd>
<dd>验 证 码:<input type="text" name="code" class="text yzm" /> <img src="code.php" id="code" onclick="javascript:this.src='code.php?tm='+Math.random();" /> <input type="submit" class="submit" value="送花" /></dd>
</dl>
</form>
</div>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。