File: /www/wwwroot/www.jwvfm.com/asp/qq.php
<?php
/**
* Created by xiaoz.
* User: lenovo
* Date: 2018/10/9
* Time: 14:39
* url:mxcloud.com
* QQ2293640950
*/
header("Content-type: text/html; charset=utf-8");
$str = file_get_contents('files/orders.txt');//将整个文件内容读入到一个字符串中
$str_encoding = mb_convert_encoding($str, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5');//转换字符集(编码)
$a1="#(.*?)\t(.*?)\t(.*?)\t1\t(.*?)\t(.*?)<\/br>#";
preg_match_all($a1,$str_encoding,$arr1);
if(!empty($arr1[0])){
if($_COOKIE["notname"] <> "" && $_COOKIE["notqq"] <> ""){
$notname=$_COOKIE["notname"];
$notqq=$_COOKIE["notqq"];
$notweixin=$_COOKIE["notweixin"];
}else{
$a=$arr1;
$sj=array_rand($a[0],1);
$notname=$arr1[2][$sj];
$notqq=$arr1[3][$sj];
$notweixin=$arr1[1][$sj];
setcookie("notname",$notname);
setcookie("notqq", $notqq);
setcookie("notweixin",$notweixin);
//写入显示次数
$a2="#(.*?)\t(.*?)\t(.*?)\t1\t(.*?)\t(.*?)<\/br>#";
preg_match_all($a2,$str_encoding,$arr2);
if(!empty($arr2[0])){
$arr2[0][$sj]= $arr2[1][$sj]."\t".$arr2[2][$sj]."\t".$arr2[3][$sj]."\t"."1"."\t".($arr2[4][$sj]+1)."\t".($arr2[5][$sj]+1)."</br>";
}
$a3="#(.*?)\t(.*?)\t(.*?)\t0\t(.*?)\t(.*?)<\/br>#";
preg_match_all($a3,$str_encoding,$arr3);
if(!empty($arr3[0])){
$arry=array_merge_recursive($arr2[0],$arr3[0]);
foreach ($arry as $key => $value){
$arry[$key]=$arry[$key]."\r\n";
}
}else{
$arry=$arr2[0];
}
file_put_contents('files/orders.txt', $arry);
}
}else{
$notname=0;
$notqq=0;
$notweixin=0;
}
?>
<script>
function showline(){
arr_wx=['<?php echo $notqq?>'];
var wx_index = Math.floor((Math.random()*arr_wx.length));
var stxlwx = arr_wx[wx_index];
window.open(stxlwx);//
}
var notname=document.getElementsByName('notname');
for(i=0;i<notname.length;i++){
notname[i].innerHTML='<?php echo $notname?>';
}
var notqq=document.getElementsByName('notqq');
for(i=0;i<notqq.length;i++){
notqq[i].innerHTML='<?php echo $notqq?>';
}
var notweixin=document.getElementsByName('notweixin');
for(i=0;i<notweixin.length;i++){
notweixin[i].innerHTML='<?php echo $notweixin ?>';
}
</script>