代码拉取完成,页面将自动刷新
<?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();
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。