Hallo zusammen,
wie bekomme ich hier eine if abfrage rein, welche auf eine vorhandene
*.sql Datei in dem Ordner "Backup" prüft und eine Fehlermeldung ausgibt,
wenn diese nicht mehr vorhanden ist?
Alles anzeigen
wie bekomme ich hier eine if abfrage rein, welche auf eine vorhandene
*.sql Datei in dem Ordner "Backup" prüft und eine Fehlermeldung ausgibt,
wenn diese nicht mehr vorhanden ist?
Quellcode
- if ($action == "showbackup") {
- $nozip = 1;
- include(ROOT_PATH.'includes/db_utils.php');
- $dir = opendir ("backup/");
- echo " <div class="contenttitle">\n";
- echo " <h2 class="widgets"><span>".$lang['list_backups']."</span></h2>\n";
- echo " </div>\n";
- echo " <div class="stdform stdform2">\n";
- while (false !== ($file = readdir($dir))) {
- if (strpos($file,'.sql',1)) {
- $date = substr($file, 9, 10);
- $time = substr($file, 20, 8);
- $filenameboth = str_replace('.sql', '', $file);
- ?>
- <script language="JavaScript">
- <!--
- function RestoreBackup(what) {
- if (confirm('<?php echo $lang['backup_restore_confirm']; ?> ' + what)) {
- window.location = "<?php echo $site_sess->url("index.php?action=restorebackup"); ?>&id=" + what;
- }
- }
- function DeleteBackup(what) {
- if (confirm('<?php echo $lang['backup_delete_confirm']; ?> ' + what)) {
- window.location = "<?php echo $site_sess->url("index.php?action=deletebackup"); ?>&file=" + what;
- }
- }
- //-->
- </script>
- <?php
- echo " <p>";
- echo " <label>" . $date . " - " . $time . "</label>";
- echo " <div class="field">";
- echo " <ul class="buttonlist">";
- echo " <li><a href="javascript:DeleteBackup('" . $filenameboth . "')" class="btn btn_trash"><span>".$lang['delete_backup']."</span></a></li>";
- echo " <li><a href="backup/".$filenameboth . ".sql" class="btn btn_link"><span>Download *.SQL</span></a></li>";
- echo " <li><a href="backup/".$filenameboth . ".zip" class="btn btn_link"><span>Download *.ZIP</span></a></li>";
- echo " <li><a href="javascript:RestoreBackup('".$file."')" class="btn btn_cloud"><span>".$lang['restore_backup']."</span></a></li>";
- echo " </ul>";
- echo " </div>";
- echo " </p>";
- }
- }
- echo "</div>";
- }