2 Star 0 Fork 0

mengskysama/NexusGet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
d.php 3.71 KB
一键复制 编辑 原始数据 按行查看 历史
mengskysama 提交于 2013-10-06 12:25 . nima
<?php
if(!isset($_GET['pass']) || !isset($_GET['type']))
die();
if($_GET['pass'] != '123456')
die();
$con = mysql_connect('localhost','root','root');
if(!$con)
{
die(mysql_error());
}
mysql_query('set names utf8');
mysql_select_db('nexusget');
$type = $_GET['type'];
if($type == 'is_get_torrent')
{
if(!isset($_GET['ori_torrent_id']))
die();
$ori_torrent_id = 0 + $_GET['ori_torrent_id'];
$sql = "SELECT id FROM torrent where ori_torrent_id = $ori_torrent_id";
$result = mysql_query($sql);
if(mysql_num_rows($result))
echo '1';
else
echo '0';
}
elseif($type == 'get_torrent')
{
if(!isset($_GET['ori_torrent_id']))
die();
if(!isset($_GET['nexus_title']))
die();
$ori_torrent_id = 0 + $_GET['ori_torrent_id'];
$nexus_title = mysql_real_escape_string($_GET['nexus_title']);
$sql = "INSERT INTO `torrent` (`ori_torrent_id`,`title`) VALUES ($ori_torrent_id, '$nexus_title')";
mysql_query($sql);
}
elseif($type == 'update_torrent_task_status')
{
if(!isset($_GET['ori_torrent_id']))
die();
if(!isset($_GET['torrent_status']))
die();
$torrent_status = 0 + $_GET['torrent_status'];
$ori_torrent_id = 0 + $_GET['ori_torrent_id'];
$sql = "UPDATE `torrent` SET status = $torrent_status where ori_torrent_id = $ori_torrent_id";
mysql_query($sql);
}
elseif($type == 'get_torrent_id')
{
if(!isset($_GET['baidu_source_url']))
die();
$baidu_source_url = mysql_real_escape_string($_GET['baidu_source_url']);
$sql = "SELECT ori_torrent_id FROM torrent where source_url = '$baidu_source_url'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if($row)
echo $row['ori_torrent_id'];
else
echo '-1';
}
elseif($type == 'update_source_url')
{
if(!isset($_GET['ori_torrent_id']))
die();
if(!isset($_GET['baidu_source_url']))
die();
$ori_torrent_id = 0 + $_GET['ori_torrent_id'];
$baidu_source_url = mysql_real_escape_string($_GET['baidu_source_url']);
$sql = "UPDATE `torrent` SET source_url = '$baidu_source_url' where ori_torrent_id = $ori_torrent_id";
mysql_query($sql);
}
elseif($type == 'update_info_hash')
{
if(!isset($_GET['ori_torrent_id']))
die();
if(!isset($_GET['torrent_info_hash']))
die();
$ori_torrent_id = 0 + $_GET['ori_torrent_id'];
$torrent_info_hash = mysql_real_escape_string($_GET['torrent_info_hash']);
$sql = "UPDATE `torrent` SET torrent_info_hash = '$torrent_info_hash' where ori_torrent_id = $ori_torrent_id";
mysql_query($sql);
}
elseif($type == 'update_gift_code')
{
if(!isset($_GET['gift_code']))
die();
if(!isset($_GET['torrent_info_hash']))
die();
$gift_code = mysql_real_escape_string($_GET['gift_code']);
$torrent_info_hash = mysql_real_escape_string($_GET['torrent_info_hash']);
$sql = "UPDATE `torrent` SET gift_code = '$gift_code' where torrent_info_hash = '$torrent_info_hash'";
mysql_query($sql);
$sql = "SELECT gift_code FROM torrent where torrent_info_hash = '$torrent_info_hash'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if($row['gift_code'] == $gift_code)
echo '0';
else
echo '1';
}
mysql_close();
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mengskysama/NexusGet.git
git@gitee.com:mengskysama/NexusGet.git
mengskysama
NexusGet
NexusGet
master

搜索帮助