📄 viewc.php
字号:
<?php
$cfg_pvchknum = 5;
$thisip = $_SERVER['REMOTE_ADDR'];
$fromurl = $_SERVER['HTTP_REFERER'];
if (!$fromurl)
{
exit ();
}
$thisfrom = parse_url ($fromurl);
$t_host = $thisfrom['host'];
$t_path = $thisfrom['path'];
$t_query = $thisfrom['query'];
$thisip = $_SERVER['REMOTE_ADDR'];
$servern = $_SERVER['SERVER_NAME'];
include_once './public/servername.php';
if (!($t_host == $servern AND $t_host == $cfg_servername))
{
echo '<script>window.opener=\'keyrunads\';window.close();</script>';
exit ();
}
$username = $_REQUEST['username'];
if (!empty ($_REQUEST['adsid']))
{
$adsid = $_REQUEST['adsid'];
}
else
{
$adsid = 'letter';
}
$web_file = '' . './data/web/' . $username . '/viewc_' . $adsid . '.txt';
if (file_exists ($web_file))
{
$data = file ($web_file);
$co = count ($data);
if ((0 < $co AND 0 < $cfg_pvchknum))
{
if ($cfg_pvchknum < $co)
{
$fi = $co - $cfg_pvchknum;
}
else
{
$fi = 0;
}
for ($i = $co - 1; $fi <= $i; --$i)
{
if (eregi ('' . $thisip, $data[$i]))
{
exit ();
continue;
}
}
}
}
$info_web = ('' . $thisip . '');
$fp_web = fopen ($web_file, 'a+');
flock ($fp_web, 3);
fwrite ($fp_web, $info_web);
fclose ($fp_web);
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -