Home > php教程 > PHP源码 > body text

获取电台的动态ip

PHP中文网
Release: 2016-05-25 17:11:28
Original
1687 people have browsed it

1. [代码]  

//filename: dns.php
//GET dns.php?mm=helong
<?php
$content = file_get_contents(&#39;ip.txt&#39;);
if($_GET["mm"]==&#39;helong&#39;)//简单认证
{
$ip = $_SERVER["REMOTE_ADDR"];
if($content!=$ip)
{
$xieru= fopen(&#39;ip.txt&#39;,&#39;w&#39;);
$result=fwrite($xieru,$ip); 
fclose($xieru); 
if($fwrite === false)
{
echo "update error!<br/>";
//飞信通知等代码....
}
else
echo "Change to ".$ip;
}
else
echo "No change ".$ip;
}
else
{
echo "Sorry,you don&#39;t have permission<br/>";
echo "Server ip: ".$content;
}

//dns.php文件上传到外部空间
//建立windows计划任务,执行下面的 bat
Copy after login

2. [代码]计划任务 批处理

@echo off
rem 关闭回显命令

cd C:\Program Files\Internet Explorer\
rem 跳入IE所在目录

start iexplore.exe "http://yourdomain.org/dns.php?mm=helong"
rem 启动IE GET提交到外部空间

ping 127.1 -n 4 >nul 
rem 延时4秒
taskkill /im iexplore.exe /f
rem 关闭IE
rem 将以上代码保存到 postip.bat
Copy after login

                   

                   

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template