summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2014-08-05 17:36:28 +0100
committerJoe Robinson <joe@lc8n.com>2014-08-05 17:36:28 +0100
commit555f2886080333b10df9812777c36c04ae6b93bc (patch)
treead05c5c98da18622c43a9e89dcbdff8c891c1b7b /index.php
parentaf4ce6f0bffeba2438f423546a4a87ea7daa3c24 (diff)
Set cookie to use current domain, made URL configurable
Diffstat (limited to 'index.php')
-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) {