/
/
home
/
u523034047
/
domains
Server: in-mum-web1112.main-hosting.eu (62.72.28.111)
You: 216.73.216.4
PHP 8.3.16
Dir:
/home/u523034047/domains
Edit:
/home/u523034047/domains/index_file_forced_restore.php
<?php // Base folder jaha saare domains hai $baseDir = "/home/u523034047/domains"; // Failed restore log file $failedLog = __DIR__ . "/failed_restore_" . date("Ymd_His") . ".txt"; // Sab domains loop me lo $domains = array_filter(glob($baseDir . "/*"), 'is_dir'); foreach ($domains as $domainPath) { $domainName = basename($domainPath); $indexFile = $domainPath . "/public_html/index.php"; $backupFile = $domainPath . "/public_html/backup_index.php"; if (file_exists($backupFile)) { // Force restore: overwrite index.php with backup_index.php if (copy($backupFile, $indexFile)) { echo "✔️ Restored backup_index.php to index.php for domain: {$domainName}\n"; } else { echo "❌ Failed to restore (copy error) for domain: {$domainName}\n"; file_put_contents($failedLog, $domainName . " | Copy error\n", FILE_APPEND); } } else { echo "⚠️ No backup_index.php found for domain: {$domainName}\n"; file_put_contents($failedLog, $domainName . " | Backup not found\n", FILE_APPEND); } } echo "\n--- Restore completed ---\n"; if (file_exists($failedLog)) { echo "❗ Some restores failed. Check log file: $failedLog\n"; } else { echo "✅ All restores successful, no failed log created.\n"; } ?>
Ukuran: 1.3 KB