// 将此脚本放在 1.com 上,它将重定向到 2.com,反之亦然
<?php
header('Location: http://2.com/index.html');
exit();
?>
如果我没有正确理解您的问题,请告诉我,我会尽我所能帮助您。
// 超级破解时间
<?php
// 1.com
$files = scandir('./*'); // not recursive, note that
$sent = file($files['log.txt']);
unset($files['log.txt']);
$notsent = array_diff($files, $sent);
foreach($notsent as $file) {
$contents = file_get_contents($file);
// Use curl to post to 2.com receiving script http://davidwalsh.name/execute-http-post-php-curl
file_put_contents($sent, $file, FILE_APPEND);
}
?>
免责声明:尚未测试,但这是做我认为你想要的最直接的方法。同样,我真的不知道您为什么要这样做。