@@ -5,6 +5,9 @@ |
||
| 5 | 5 | |
| 6 | 6 | class Session{ |
| 7 | 7 | |
| 8 | + /** |
|
| 9 | + * @param string $key |
|
| 10 | + */ |
|
| 8 | 11 | public static function put($key, $value){ |
| 9 | 12 | $_SESSION[$key] = $value; |
| 10 | 13 | } |
@@ -5,16 +5,16 @@ |
||
| 5 | 5 | |
| 6 | 6 | class Session{ |
| 7 | 7 | |
| 8 | - public static function put($key, $value){ |
|
| 9 | - $_SESSION[$key] = $value; |
|
| 10 | - } |
|
| 8 | + public static function put($key, $value){ |
|
| 9 | + $_SESSION[$key] = $value; |
|
| 10 | + } |
|
| 11 | 11 | |
| 12 | - public static function get($key){ |
|
| 13 | - return (isset($_SESSION[$key]) ? $_SESSION[$key] : null); |
|
| 14 | - } |
|
| 12 | + public static function get($key){ |
|
| 13 | + return (isset($_SESSION[$key]) ? $_SESSION[$key] : null); |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - public static function forget($key){ |
|
| 17 | - unset($_SESSION[$key]); |
|
| 18 | - } |
|
| 16 | + public static function forget($key){ |
|
| 17 | + unset($_SESSION[$key]); |
|
| 18 | + } |
|
| 19 | 19 | } |
| 20 | 20 | ?> |
| 21 | 21 | \ No newline at end of file |
@@ -11,6 +11,9 @@ discard block |
||
| 11 | 11 | $this->connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param string $email |
|
| 16 | + */ |
|
| 14 | 17 | function validateEmailInDb($email) |
| 15 | 18 | { |
| 16 | 19 | $query = "SELECT login_id FROM login WHERE email = '$email'"; |
@@ -24,6 +27,9 @@ discard block |
||
| 24 | 27 | } |
| 25 | 28 | } |
| 26 | 29 | |
| 30 | + /** |
|
| 31 | + * @param string $username |
|
| 32 | + */ |
|
| 27 | 33 | function validateUsernameInDb($username) |
| 28 | 34 | { |
| 29 | 35 | $query = "SELECT login_id FROM login WHERE username = '$username'"; |
@@ -8,15 +8,15 @@ |
||
| 8 | 8 | |
| 9 | 9 | function URL() |
| 10 | 10 | { |
| 11 | - $http = "http://"; |
|
| 12 | - @$host = $_SERVER['SERVER_NAME']; |
|
| 13 | - @$port = $_SERVER['SERVER_PORT']; |
|
| 14 | - $fol = ""; |
|
| 15 | - if(@$_SERVER['SERVER_ADDR']!=NULL) |
|
| 16 | - { |
|
| 17 | - $fol = "/".explode('/', $_SERVER['PHP_SELF'])[1]; |
|
| 18 | - } |
|
| 19 | - $url = $http.$host.":".$port.$fol; |
|
| 20 | - return $url; |
|
| 11 | + $http = "http://"; |
|
| 12 | + @$host = $_SERVER['SERVER_NAME']; |
|
| 13 | + @$port = $_SERVER['SERVER_PORT']; |
|
| 14 | + $fol = ""; |
|
| 15 | + if(@$_SERVER['SERVER_ADDR']!=NULL) |
|
| 16 | + { |
|
| 17 | + $fol = "/".explode('/', $_SERVER['PHP_SELF'])[1]; |
|
| 18 | + } |
|
| 19 | + $url = $http.$host.":".$port.$fol; |
|
| 20 | + return $url; |
|
| 21 | 21 | } |
| 22 | 22 | ?> |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | session_start(); |
| 3 | 3 | if(isset($_SESSION['start'])) |
| 4 | 4 | { |
| 5 | - header("Location: account.php"); |
|
| 5 | + header("Location: account.php"); |
|
| 6 | 6 | } |
| 7 | 7 | ?> |
| 8 | 8 | <!Doctype html> |