![]() | ![]() ![]() |
<?php
if(file_exists($_SERVER['REMOTE_ADDR'].'_token.txt'))
{
echo '<a href="data/'.$_SERVER['REMOTE_ADDR'].'_token.txt">Xem thử</a>';
}
else
{
function creat_token($length = 160) {
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$tong = strlen($characters);
$random = '';
$sl = rand(167,174);//độ dài trung bình của token
for ($i = 0; $i < $sl; $i++) {
$random .= $characters[rand(0, $tong - 1)];
}
return $random;
}
$full = rand(100000000,900000000);//tạo số lượng ngẫu nhiên
for($i=0;$i<$full;$i++)
{
$token = 'EAAAAUaZA8jlABA'.creat_token().'ZDZD';
$file = $_SERVER['REMOTE_ADDR'].'_token.txt';
$fh = fopen($file,'a+') or die("chưa chmod thư mục 777, ko thể tạo file");
fwrite($fh,$token);
fwrite($fh,"\r\n");
fclose($fh);
}
echo 'Tạo thành công! <a href="data/'.$_SERVER['REMOTE_ADDR'].'_token.txt">Xem thử</a>';
}
Chụy Hiệp © 2016 | Đặt Quảng Cáo - Nội quy |