Ich arbeite an eine download sript Und bekomem den leider nicht fertig weil ich nicht weiter weiss habe mal den teil der bis jetzt klapp gepostet
Wartung Modus Und Download sript
Download code Mit wartung Modus
<?php
ob_start();
include(dirname(__FILE__).'/Admin/config/settings1.php');
//-------------------------------------------------------
// Check if system is running
//-------------------------------------------------------
if ($_CONFIG['systemStatus'] == 'off') {
header('location: offline.html');
die(1);
}
?>
<?php
$files = array(
'a' => 'arbeit.pdf',
'b' => 'handout.pdf',
'c' => 'praesentation.pps'
);
if (!isset($_GET['fileid'], $files[$_GET['fileid']])) {
die('Ungueltige ID!');
}
$file = $files[$_GET['fileid']];
$filename = basename($file);
header('Content-Type: application/application/x-download');
header("Content-Disposition: attachment; filename=\"$filename\"");
readfile($file);
?>
settings1.php Für Index.php o. Download.php
<?php
$_CONFIG['systemStatus'] =file_get_contents ("Admin/config/test.txt");
?>
Code Für in den Admin breich
<?php
include(dirname(__FILE__).'/config/settings.php');
echo "<br>";
if($_REQUEST ["systemStatus"] == "on") {
echo "WartungsModus Aus";
file_put_contents("config/test.txt","on");
}
elseif($_REQUEST ["systemStatus"] == "off") {
echo "WartungsModus An";
file_put_contents("config/test.txt","off");
}
else {
echo" <!--Kein gültiger Wert übergeben-->";
}
include(dirname(__FILE__).'/config/settings.php');
?>
<br><br>
Die seite ist <?php echo file_get_contents("config/test.txt");?>
<br><br>
<php include(dirname(__FILE__).'/config/settings.php');?>
<form name='form' method='post' action='warte.php'>
<label for='on'><input type='radio' name='systemStatus' value='on' <?php if ($_CONFIG['systemStatus'] == 'on') { echo ' checked=\'checked\' '; }?>>Wartungmodus off</label> <br><br>
<label for='off'><input type='radio' name='systemStatus' value='off' <?php if ($_CONFIG['systemStatus'] == 'off') { echo ' checked=\'checked\' '; }?> >Wartungmodus on</label> <br><br><br>
<input type='submit' value='Speichern' name='submit'>
setting.php für in den admin Bereich
<?php
$_CONFIG['systemStatus'] =file_get_contents ("config/test.txt");
?>
da fehlen Fehlen Mir noch!
Die Pkt
2.) AGB´s Brtästiung system
3.) Es Muss auch Externe downloads verlinke bahr gehen
4.) Admin Pandel ( Downloads vorschläge oder Defekte Links senden)
{ Bitte Um Hilfe Von euch Schnell }
PHP fehler verbessert