Fixed some logic.
This commit is contained in:
parent
6f2aa4fd4a
commit
bf36b285d1
@ -2,14 +2,17 @@
|
||||
// Start the session
|
||||
session_start();
|
||||
|
||||
if (isset($_SESSION["state"])) {
|
||||
$state = $_SESSION["state"];
|
||||
if (isset($_SESSION["refreshState"])) {
|
||||
$state = $_SESSION["refreshState"];
|
||||
} else {
|
||||
$state = "none";
|
||||
$_SESSION["refreshState"] = $state;
|
||||
}
|
||||
|
||||
header('Content-Type: text/event-stream');
|
||||
header('Cache-Control: no-cache');
|
||||
echo "data:" . $state . "\n\n";
|
||||
|
||||
$_SESSION["state"] = "none";
|
||||
$_SESSION["refreshState"] = "none";
|
||||
flush();
|
||||
?>
|
||||
|
@ -52,14 +52,13 @@ function uploadFiles($targetDir) {
|
||||
if ($uploadOk !== 0) {
|
||||
if (move_uploaded_file($fileTmpName, $targetFile)) {
|
||||
echo "<span class='success'>Server: [Success] --> The file " . $fileName . " has been uploaded.</span>";
|
||||
$_SESSION["refreshState"] = "updateListing";
|
||||
}
|
||||
} else {
|
||||
echo "<span class='error'>Server: [Error] --> Your file " . $fileName . " was not uploaded.</span>";
|
||||
}
|
||||
}
|
||||
echo "</body></html>";
|
||||
|
||||
$_SESSION["state"] = "updateListing";
|
||||
}
|
||||
|
||||
// Check access type.
|
||||
|
Loading…
Reference in New Issue
Block a user