0%

动态域名

动态域名

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
* @description/描述 获取ip更新ip 动态域名
* @author/作者 zecheng
* @filename/文件名 ip.php
* @createDate/创建日期
* @ModifyDate/修改日期
*/

$ipTmp = file_get_contents("http://pv.sohu.com/cityjson?ie=utf-8");
$preg = '/\d+\.\d+\.\d+\.\d+/';
$oupt = array();
preg_match_all($preg, $ipTmp, $oupt);
$userANDpass = '密码/账号';
$url = "http://members.3322.net/dyndns/update";
$log = "?hostname=xxx.f3322.org&myip=" . $oupt[0][0];
$head[] = "Authorization:Basic " . base64_encode($userANDpass . ":" . $userANDpass);
$ch = curl_init($url . $log);
curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
curl_setopt($ch, CURLOPT_URL, $url . $log);
$u = curl_exec($ch);
curl_close($ch);
echo $u;

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!