我无法在此脚本中取消设置此会话,从而导致错误。我知道这是会议,因为当我重新启动浏览器时它再次运行。
脚本:
if (isset($_POST['file_upload_submit']) && isset($name) && $delete_after == '1 Day') {
if (!empty($name)) {
session_start();
$_SESSION['file_id'] = uniqid('');
$location_1_day = 'uploads/1/' . $_SESSION['file_id'] . '/' . $_SESSION['file_id'] . '/' . $name;
$refresh_1_day = 'uploads/1/' . $_SESSION['file_id'] . '/' . $_SESSION['file_id'] . '.php';
mkdir('uploads/1/' . $_SESSION['file_id'] . '/');
mkdir('uploads/1/' . $_SESSION['file_id'] . '/' . $_SESSION['file_id']);
if (move_uploaded_file($tmp_location, $location_1_day)) {
$handle_1_day = fopen('uploads/1/' . $_SESSION['file_id'] . '/' . $_SESSION['file_id'] . '.php', 'w');
fwrite($handle_1_day, '<?PHP require(\'../../../template_1.php\'); ?>');
session_destroy();
header('Location: '.$refresh_1_day.'');
}
}
}
我收到以下错误:
Warning: move_uploaded_file(uploads//template_1.php): failed to open stream: No such file or directory in C:\xampp\htdocs\TESTING_SERVER\KronoFiles\uploads\index.php on line 110
和
Warning: move_uploaded_file(): Unable to move 'C:\xampp\tmp\phpEF6B.tmp' to 'uploads//template_1.php' in C:\xampp\htdocs\TESTING_SERVER\KronoFiles\uploads\index.php on line 110