diff options
author | Joe Robinson <joe@lc8n.com> | 2014-08-05 17:36:28 +0100 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2014-08-05 17:36:28 +0100 |
commit | 555f2886080333b10df9812777c36c04ae6b93bc (patch) | |
tree | ad05c5c98da18622c43a9e89dcbdff8c891c1b7b | |
parent | af4ce6f0bffeba2438f423546a4a87ea7daa3c24 (diff) |
Set cookie to use current domain, made URL configurable
-rw-r--r-- | index.php | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) { |