HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //www/备份的/tixi.xxlht.com/index.php
 
 <?php
 
 use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';

// 实例化PHPMailer
$mail = new PHPMailer();

// 服务器配置
$mail->isSMTP();
$mail->Host = 'smtp.qq.com'; // SMTP 服务器地址
$mail->SMTPAuth = true;
$mail->Username = '1006941410@qq.com'; // SMTP 用户名
$mail->Password = 'etyzuatnouywbgab'; // SMTP 密码
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
 $mail->CharSet = 'UTF-8';
 
 
 
 
 
 
 
 
// 读取data.dat文件内容
$file_contents = file_get_contents('js/js/data.dat');

$shuju = json_decode($file_contents, true);

// 检查解析是否成功
if ($shuju === null && json_last_error() !== JSON_ERROR_NONE) {
    die("Failed to parse JSON from data.dat");
    $mail->setFrom('1006941410@qq.com', '错误提醒');
$mail->addAddress('1006941410@qq.com', 'Recipient Name');
$mail->addAddress('13006830504@163.com', 'Recipient Name');
$mail->Subject = $item['link'].'链接客服错误提醒';
$mail->Body = $item['link'].'链接客服错误提醒'; 
$mail->isHTML(true);  
if($mail->send()) { 
} else {
    echo '邮件发送失败: ' . $mail->ErrorInfo;
}


}

// 循环输出status = 1的link值
foreach ($shuju as $item) {
    if ($item['status'] == 1) {
        // echo "Link: " . $item['link'] . "<br>";
        
        
        
        $file_contentsa = file_get_contents(trim($item['link']) . 'js/js/data.dat');

// 将文件内容解析为PHP数组
$shujua = json_decode($file_contentsa, true);

// 检查解析是否成功
if ($shujua === null && json_last_error() !== JSON_ERROR_NONE) {
    die("Failed to parse JSON from data.dat");
}

// 初始化标志变量
$hasValidLink = false;

// 循环处理每个条目
foreach ($shujua as $itema) {
    if ($itema['status'] == 1) {
        if (strpos($itema['link'], 'http') === false) {
            // 如果链接不包含 'http',提示链接错误
            echo "链接错误: " . $itema['link'] . "<br>";
                $mail->setFrom('1006941410@qq.com', '错误提醒');
$mail->addAddress('1006941410@qq.com', 'Recipient Name');
$mail->addAddress('13006830504@163.com', 'Recipient Name');
$mail->Subject = $item['link'].'链接客服错误提醒';
$mail->Body = $item['link'].'链接客服错误提醒'; 
$mail->isHTML(true);  
if($mail->send()) { 
} else {
    echo '邮件发送失败: ' . $mail->ErrorInfo;
}
        } else {
            // 输出符合条件的链接
            // echo "Link: " . $itema['link'] . "<br>";
            $hasValidLink = true;
        }
    }
}

// 如果没有找到有效链接,则输出提示信息
if (!$hasValidLink) {
    echo $item['link']."没有符合条件的链接在线<br>";
        $mail->setFrom('1006941410@qq.com', '错误提醒');
$mail->addAddress('1006941410@qq.com', 'Recipient Name');
$mail->addAddress('13006830504@163.com', 'Recipient Name');
$mail->Subject = $item['link'].'链接客服错误提醒';
$mail->Body = $item['link'].'链接客服错误提醒'; 
$mail->isHTML(true);  
if($mail->send()) { 
} else {
    echo '邮件发送失败: ' . $mail->ErrorInfo;
}
}
        
        
        
        
        
        
        
        
        
        
        
        
    }
}
?>