summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/index.php b/index.php
index ed2cdc9..2c5af4e 100644
--- a/index.php
+++ b/index.php
@@ -2,19 +2,20 @@
$pass = 'REPLACE THIS WITH A SHA256 HASH OR SET VARIABLE TO NULL';
$indexignore = array();
$headerfile = "upload.html";
+$url = "http://www.blaupload.co.uk/";
if ($_POST && $pass) {
if ((hash("sha256", $_POST['password']) == $pass)) {
if (isset($_POST['rememberme'])) {
/* Set cookie to last 1 year */
- setcookie('password', hash("sha256", $_POST['password']), time()+60*60*24*365, '/', 'www.blaupload.co.uk');
+ setcookie('password', hash("sha256", $_POST['password']), time()+60*60*24*365, '/', $_SERVER['SERVER_NAME'] );
} else {
/* Cookie expires when browser closes */
- setcookie('password', hash("sha256", $_POST['password']), false, '/', 'www.blaupload.co.uk');
+ setcookie('password', hash("sha256", $_POST['password']), false, '/', $_SERVER['SERVER_NAME'] );
}
- header('Location: http://www.blaupload.co.uk/');
+ header('Location: ' . $url);
} else {
- header('Location: http://www.blaupload.co.uk/');
+ header('Location: ' . $url);
exit();
}
} else if ($pass) {