@@ -3,22 +3,22 @@ |
||
3 | 3 | namespace ChatApp; |
4 | 4 | session_start(); |
5 | 5 | |
6 | -class Session{ |
|
6 | +class Session { |
|
7 | 7 | |
8 | 8 | public function __construct() |
9 | 9 | { |
10 | 10 | # code |
11 | 11 | } |
12 | 12 | |
13 | - public function put($key, $value){ |
|
13 | + public function put($key, $value) { |
|
14 | 14 | $_SESSION[$key] = $value; |
15 | 15 | } |
16 | 16 | |
17 | - public function get($key){ |
|
17 | + public function get($key) { |
|
18 | 18 | return (isset($_SESSION[$key]) ? $_SESSION[$key] : null); |
19 | 19 | } |
20 | 20 | |
21 | - public function forget($key){ |
|
21 | + public function forget($key) { |
|
22 | 22 | unset($_SESSION[$key]); |
23 | 23 | } |
24 | 24 | } |
@@ -7,116 +7,116 @@ |
||
7 | 7 | |
8 | 8 | class Register |
9 | 9 | { |
10 | - protected $error; |
|
11 | - protected $key; |
|
12 | - protected $obValidate; |
|
13 | - protected $connect; |
|
14 | - protected $session; |
|
10 | + protected $error; |
|
11 | + protected $key; |
|
12 | + protected $obValidate; |
|
13 | + protected $connect; |
|
14 | + protected $session; |
|
15 | 15 | |
16 | - public function __construct() |
|
17 | - { |
|
18 | - $this->error = array(); |
|
19 | - $this->key = 0; |
|
20 | - $this->connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); |
|
21 | - $this->session = new Session(); |
|
22 | - $this->obValidate = new Validate(); |
|
16 | + public function __construct() |
|
17 | + { |
|
18 | + $this->error = array(); |
|
19 | + $this->key = 0; |
|
20 | + $this->connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); |
|
21 | + $this->session = new Session(); |
|
22 | + $this->obValidate = new Validate(); |
|
23 | 23 | |
24 | - } |
|
24 | + } |
|
25 | 25 | |
26 | - public function authRegister($name, $email, $username, $password, $mob) |
|
27 | - { |
|
28 | - $name = trim($name); |
|
29 | - $email = trim($email); |
|
30 | - $username = trim($username); |
|
31 | - $password = trim($password); |
|
32 | - $mob = trim($mob); |
|
33 | - $userId = ''; |
|
26 | + public function authRegister($name, $email, $username, $password, $mob) |
|
27 | + { |
|
28 | + $name = trim($name); |
|
29 | + $email = trim($email); |
|
30 | + $username = trim($username); |
|
31 | + $password = trim($password); |
|
32 | + $mob = trim($mob); |
|
33 | + $userId = ''; |
|
34 | 34 | |
35 | - if (empty($name)) { |
|
36 | - $this->onError(["name" => " *Enter the name"]); |
|
37 | - } |
|
35 | + if (empty($name)) { |
|
36 | + $this->onError(["name" => " *Enter the name"]); |
|
37 | + } |
|
38 | 38 | |
39 | - if(empty($email)) { |
|
40 | - $this->onError(["email" => " *Enter the email address"]); |
|
41 | - } |
|
42 | - elseif(filter_var($email, FILTER_VALIDATE_EMAIL) == false) { |
|
43 | - $this->onError(["email" => " *Enter correct Email address"]); |
|
44 | - } |
|
45 | - else |
|
46 | - { |
|
47 | - if($this->obValidate->validateEmailInDb($email) === 1) |
|
48 | - { |
|
39 | + if(empty($email)) { |
|
40 | + $this->onError(["email" => " *Enter the email address"]); |
|
41 | + } |
|
42 | + elseif(filter_var($email, FILTER_VALIDATE_EMAIL) == false) { |
|
43 | + $this->onError(["email" => " *Enter correct Email address"]); |
|
44 | + } |
|
45 | + else |
|
46 | + { |
|
47 | + if($this->obValidate->validateEmailInDb($email) === 1) |
|
48 | + { |
|
49 | 49 | |
50 | - $this->onError(["email" => " *Email is already registered"]); |
|
51 | - } |
|
52 | - } |
|
50 | + $this->onError(["email" => " *Email is already registered"]); |
|
51 | + } |
|
52 | + } |
|
53 | 53 | |
54 | - if(empty($username)) { |
|
55 | - $this->onError(["username" => " *Enter the username"]); |
|
56 | - } |
|
57 | - else |
|
58 | - { |
|
59 | - if($this->obValidate->validateUsernameInDb($username) === 1) |
|
60 | - { |
|
54 | + if(empty($username)) { |
|
55 | + $this->onError(["username" => " *Enter the username"]); |
|
56 | + } |
|
57 | + else |
|
58 | + { |
|
59 | + if($this->obValidate->validateUsernameInDb($username) === 1) |
|
60 | + { |
|
61 | 61 | |
62 | - $this->onError(["username" => " *Username is already registered"]); |
|
63 | - } |
|
64 | - } |
|
62 | + $this->onError(["username" => " *Username is already registered"]); |
|
63 | + } |
|
64 | + } |
|
65 | 65 | |
66 | - if(empty($password)) { |
|
67 | - $this->onError(["password" => " *Enter the password"]); |
|
68 | - } |
|
66 | + if(empty($password)) { |
|
67 | + $this->onError(["password" => " *Enter the password"]); |
|
68 | + } |
|
69 | 69 | |
70 | - if(empty($mob)) { |
|
71 | - $this->onError(["mob" => " *Enter the Mobile Number"]); |
|
72 | - } |
|
73 | - elseif (!preg_match("/^[0-9]{10}$/", $mob)) { |
|
74 | - $this->onError(["mob" => " *Enter correct Mobile Number"]); |
|
75 | - } |
|
70 | + if(empty($mob)) { |
|
71 | + $this->onError(["mob" => " *Enter the Mobile Number"]); |
|
72 | + } |
|
73 | + elseif (!preg_match("/^[0-9]{10}$/", $mob)) { |
|
74 | + $this->onError(["mob" => " *Enter correct Mobile Number"]); |
|
75 | + } |
|
76 | 76 | |
77 | - if($this->key == 1) |
|
78 | - { |
|
79 | - return json_encode($this->error); |
|
80 | - } |
|
81 | - else |
|
82 | - { |
|
83 | - $this->key = 0; |
|
84 | - $pass = md5($password); |
|
85 | - $query = "INSERT INTO register VALUES(null, '$email', '$username', '$pass')"; |
|
86 | - if(!$this->connect->query($query)) { |
|
87 | - $this->key = 1; |
|
88 | - echo "You are not registered || Error in registration2"; |
|
89 | - } |
|
90 | - else |
|
91 | - { |
|
92 | - $query = "SELECT id FROM register WHERE email = '$email'"; |
|
93 | - if($result = $this->connect->query($query)) { |
|
94 | - $row = $result->fetch_assoc(); |
|
95 | - $userId = $row['id']; |
|
77 | + if($this->key == 1) |
|
78 | + { |
|
79 | + return json_encode($this->error); |
|
80 | + } |
|
81 | + else |
|
82 | + { |
|
83 | + $this->key = 0; |
|
84 | + $pass = md5($password); |
|
85 | + $query = "INSERT INTO register VALUES(null, '$email', '$username', '$pass')"; |
|
86 | + if(!$this->connect->query($query)) { |
|
87 | + $this->key = 1; |
|
88 | + echo "You are not registered || Error in registration2"; |
|
89 | + } |
|
90 | + else |
|
91 | + { |
|
92 | + $query = "SELECT id FROM register WHERE email = '$email'"; |
|
93 | + if($result = $this->connect->query($query)) { |
|
94 | + $row = $result->fetch_assoc(); |
|
95 | + $userId = $row['id']; |
|
96 | 96 | |
97 | - $query = "INSERT INTO login VALUES('$userId', '$name', '$email', '$username', '$mob', 0)"; |
|
98 | - if(!$this->connect->query($query)) { |
|
99 | - $this->key = 1; |
|
100 | - echo "You are not registered || Error in registration1"; |
|
101 | - } |
|
102 | - } |
|
103 | - } |
|
104 | - } |
|
105 | - if ($this->key == 0) { |
|
106 | - $this->session->put('start', $userId); |
|
107 | - return json_encode([ |
|
108 | - "location" => URL."/account.php" |
|
109 | - ]); |
|
110 | - } |
|
111 | - else |
|
112 | - { |
|
113 | - return json_encode($this->error); |
|
114 | - } |
|
115 | - } |
|
97 | + $query = "INSERT INTO login VALUES('$userId', '$name', '$email', '$username', '$mob', 0)"; |
|
98 | + if(!$this->connect->query($query)) { |
|
99 | + $this->key = 1; |
|
100 | + echo "You are not registered || Error in registration1"; |
|
101 | + } |
|
102 | + } |
|
103 | + } |
|
104 | + } |
|
105 | + if ($this->key == 0) { |
|
106 | + $this->session->put('start', $userId); |
|
107 | + return json_encode([ |
|
108 | + "location" => URL."/account.php" |
|
109 | + ]); |
|
110 | + } |
|
111 | + else |
|
112 | + { |
|
113 | + return json_encode($this->error); |
|
114 | + } |
|
115 | + } |
|
116 | 116 | |
117 | - public function onError($value) |
|
118 | - { |
|
119 | - $this->key = 1; |
|
120 | - $this->error = array_merge($this->error, $value); |
|
121 | - } |
|
117 | + public function onError($value) |
|
118 | + { |
|
119 | + $this->key = 1; |
|
120 | + $this->error = array_merge($this->error, $value); |
|
121 | + } |
|
122 | 122 | } |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | namespace ChatApp; |
4 | 4 | use ChatApp\Validate; |
5 | 5 | use ChatApp\Session; |
6 | -require_once (dirname(__DIR__) . '/config/database.php'); |
|
6 | +require_once (dirname(__DIR__).'/config/database.php'); |
|
7 | 7 | |
8 | 8 | class Register |
9 | 9 | { |
@@ -36,45 +36,45 @@ discard block |
||
36 | 36 | $this->onError(["name" => " *Enter the name"]); |
37 | 37 | } |
38 | 38 | |
39 | - if(empty($email)) { |
|
39 | + if (empty($email)) { |
|
40 | 40 | $this->onError(["email" => " *Enter the email address"]); |
41 | 41 | } |
42 | - elseif(filter_var($email, FILTER_VALIDATE_EMAIL) == false) { |
|
42 | + elseif (filter_var($email, FILTER_VALIDATE_EMAIL) == false) { |
|
43 | 43 | $this->onError(["email" => " *Enter correct Email address"]); |
44 | 44 | } |
45 | 45 | else |
46 | 46 | { |
47 | - if($this->obValidate->validateEmailInDb($email) === 1) |
|
47 | + if ($this->obValidate->validateEmailInDb($email) === 1) |
|
48 | 48 | { |
49 | 49 | |
50 | 50 | $this->onError(["email" => " *Email is already registered"]); |
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | - if(empty($username)) { |
|
54 | + if (empty($username)) { |
|
55 | 55 | $this->onError(["username" => " *Enter the username"]); |
56 | 56 | } |
57 | 57 | else |
58 | 58 | { |
59 | - if($this->obValidate->validateUsernameInDb($username) === 1) |
|
59 | + if ($this->obValidate->validateUsernameInDb($username) === 1) |
|
60 | 60 | { |
61 | 61 | |
62 | 62 | $this->onError(["username" => " *Username is already registered"]); |
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | - if(empty($password)) { |
|
66 | + if (empty($password)) { |
|
67 | 67 | $this->onError(["password" => " *Enter the password"]); |
68 | 68 | } |
69 | 69 | |
70 | - if(empty($mob)) { |
|
70 | + if (empty($mob)) { |
|
71 | 71 | $this->onError(["mob" => " *Enter the Mobile Number"]); |
72 | 72 | } |
73 | 73 | elseif (!preg_match("/^[0-9]{10}$/", $mob)) { |
74 | 74 | $this->onError(["mob" => " *Enter correct Mobile Number"]); |
75 | 75 | } |
76 | 76 | |
77 | - if($this->key == 1) |
|
77 | + if ($this->key == 1) |
|
78 | 78 | { |
79 | 79 | return json_encode($this->error); |
80 | 80 | } |
@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | $this->key = 0; |
84 | 84 | $pass = md5($password); |
85 | 85 | $query = "INSERT INTO register VALUES(null, '$email', '$username', '$pass')"; |
86 | - if(!$this->connect->query($query)) { |
|
86 | + if (!$this->connect->query($query)) { |
|
87 | 87 | $this->key = 1; |
88 | 88 | echo "You are not registered || Error in registration2"; |
89 | 89 | } |
90 | 90 | else |
91 | 91 | { |
92 | 92 | $query = "SELECT id FROM register WHERE email = '$email'"; |
93 | - if($result = $this->connect->query($query)) { |
|
93 | + if ($result = $this->connect->query($query)) { |
|
94 | 94 | $row = $result->fetch_assoc(); |
95 | 95 | $userId = $row['id']; |
96 | 96 | |
97 | 97 | $query = "INSERT INTO login VALUES('$userId', '$name', '$email', '$username', '$mob', 0)"; |
98 | - if(!$this->connect->query($query)) { |
|
98 | + if (!$this->connect->query($query)) { |
|
99 | 99 | $this->key = 1; |
100 | 100 | echo "You are not registered || Error in registration1"; |
101 | 101 | } |
@@ -38,11 +38,9 @@ discard block |
||
38 | 38 | |
39 | 39 | if(empty($email)) { |
40 | 40 | $this->onError(["email" => " *Enter the email address"]); |
41 | - } |
|
42 | - elseif(filter_var($email, FILTER_VALIDATE_EMAIL) == false) { |
|
41 | + } elseif(filter_var($email, FILTER_VALIDATE_EMAIL) == false) { |
|
43 | 42 | $this->onError(["email" => " *Enter correct Email address"]); |
44 | - } |
|
45 | - else |
|
43 | + } else |
|
46 | 44 | { |
47 | 45 | if($this->obValidate->validateEmailInDb($email) === 1) |
48 | 46 | { |
@@ -53,8 +51,7 @@ discard block |
||
53 | 51 | |
54 | 52 | if(empty($username)) { |
55 | 53 | $this->onError(["username" => " *Enter the username"]); |
56 | - } |
|
57 | - else |
|
54 | + } else |
|
58 | 55 | { |
59 | 56 | if($this->obValidate->validateUsernameInDb($username) === 1) |
60 | 57 | { |
@@ -69,16 +66,14 @@ discard block |
||
69 | 66 | |
70 | 67 | if(empty($mob)) { |
71 | 68 | $this->onError(["mob" => " *Enter the Mobile Number"]); |
72 | - } |
|
73 | - elseif (!preg_match("/^[0-9]{10}$/", $mob)) { |
|
69 | + } elseif (!preg_match("/^[0-9]{10}$/", $mob)) { |
|
74 | 70 | $this->onError(["mob" => " *Enter correct Mobile Number"]); |
75 | 71 | } |
76 | 72 | |
77 | 73 | if($this->key == 1) |
78 | 74 | { |
79 | 75 | return json_encode($this->error); |
80 | - } |
|
81 | - else |
|
76 | + } else |
|
82 | 77 | { |
83 | 78 | $this->key = 0; |
84 | 79 | $pass = md5($password); |
@@ -86,8 +81,7 @@ discard block |
||
86 | 81 | if(!$this->connect->query($query)) { |
87 | 82 | $this->key = 1; |
88 | 83 | echo "You are not registered || Error in registration2"; |
89 | - } |
|
90 | - else |
|
84 | + } else |
|
91 | 85 | { |
92 | 86 | $query = "SELECT id FROM register WHERE email = '$email'"; |
93 | 87 | if($result = $this->connect->query($query)) { |
@@ -107,8 +101,7 @@ discard block |
||
107 | 101 | return json_encode([ |
108 | 102 | "location" => URL."/account.php" |
109 | 103 | ]); |
110 | - } |
|
111 | - else |
|
104 | + } else |
|
112 | 105 | { |
113 | 106 | return json_encode($this->error); |
114 | 107 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | namespace ChatApp; |
4 | -require_once (dirname(__DIR__) . '/config/database.php'); |
|
4 | +require_once (dirname(__DIR__).'/config/database.php'); |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * For checking online status |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); |
15 | 15 | $query = "Update login set login_status = 1 where login_id = '$userId'"; |
16 | - if(!$connect->query($query)); |
|
16 | + if (!$connect->query($query)); |
|
17 | 17 | echo $connect->error; |
18 | 18 | $connect->close(); |
19 | 19 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); |
24 | 24 | $query = "Update login set login_status = 0 where login_id = '$userId'"; |
25 | - if(!$connect->query($query)); |
|
25 | + if (!$connect->query($query)); |
|
26 | 26 | echo $connect->error; |
27 | 27 | $connect->close(); |
28 | 28 | } |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | namespace ChatApp; |
4 | -require_once (dirname(__DIR__) . '/config/database.php'); |
|
4 | +require_once (dirname(__DIR__).'/config/database.php'); |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * For retreiving User Profile |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); |
15 | 15 | $query = "SELECT * from profile where login_id = '$userId'"; |
16 | 16 | $result = $connect->query($query); |
17 | - if($result->num_rows > 0) // if true |
|
17 | + if ($result->num_rows > 0) // if true |
|
18 | 18 | { |
19 | 19 | $details = $result->fetch_assoc(); |
20 | 20 | return $details; |
@@ -14,12 +14,13 @@ |
||
14 | 14 | $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); |
15 | 15 | $query = "SELECT * from profile where login_id = '$userId'"; |
16 | 16 | $result = $connect->query($query); |
17 | - if($result->num_rows > 0) // if true |
|
17 | + if($result->num_rows > 0) { |
|
18 | + // if true |
|
18 | 19 | { |
19 | 20 | $details = $result->fetch_assoc(); |
20 | - return $details; |
|
21 | 21 | } |
22 | - else |
|
22 | + return $details; |
|
23 | + } else |
|
23 | 24 | { |
24 | 25 | return NULL; |
25 | 26 | } |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require (__DIR__ . '/vendor/autoload.php'); |
|
3 | +require (__DIR__.'/vendor/autoload.php'); |
|
4 | 4 | use ChatApp\Session; |
5 | 5 | |
6 | -if(Session::get('start') != null) |
|
6 | +if (Session::get('start') != null) |
|
7 | 7 | { |
8 | 8 | Session::forget('start'); |
9 | 9 | header('Location: index.php'); |
@@ -12,8 +12,7 @@ |
||
12 | 12 | header('Location: ../../index.php'); |
13 | 13 | } |
14 | 14 | |
15 | -} |
|
16 | -else |
|
15 | +} else |
|
17 | 16 | { |
18 | 17 | echo "Please Login"; |
19 | 18 | } |
@@ -5,13 +5,13 @@ |
||
5 | 5 | |
6 | 6 | if(isset($_POST['q'])) |
7 | 7 | { |
8 | - $loginField = json_decode($_POST['q']); |
|
9 | - $login = $loginField->login; |
|
10 | - $password = $loginField->password; |
|
11 | - $obLogin = new Login(); |
|
12 | - $result = $obLogin->authLogin($login, $password); |
|
13 | - if(isset($result)) |
|
14 | - echo $result; |
|
15 | - else |
|
16 | - echo json_encode([]); |
|
8 | + $loginField = json_decode($_POST['q']); |
|
9 | + $login = $loginField->login; |
|
10 | + $password = $loginField->password; |
|
11 | + $obLogin = new Login(); |
|
12 | + $result = $obLogin->authLogin($login, $password); |
|
13 | + if(isset($result)) |
|
14 | + echo $result; |
|
15 | + else |
|
16 | + echo json_encode([]); |
|
17 | 17 | } |
18 | 18 | \ No newline at end of file |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require (dirname(__DIR__) . '/vendor/autoload.php'); |
|
3 | +require (dirname(__DIR__).'/vendor/autoload.php'); |
|
4 | 4 | use ChatApp\Login; |
5 | 5 | |
6 | -if(isset($_POST['q'])) |
|
6 | +if (isset($_POST['q'])) |
|
7 | 7 | { |
8 | 8 | $loginField = json_decode($_POST['q']); |
9 | 9 | $login = $loginField->login; |
10 | 10 | $password = $loginField->password; |
11 | 11 | $obLogin = new Login(); |
12 | 12 | $result = $obLogin->authLogin($login, $password); |
13 | - if(isset($result)) |
|
13 | + if (isset($result)) |
|
14 | 14 | echo $result; |
15 | 15 | else |
16 | 16 | echo json_encode([]); |
@@ -10,8 +10,9 @@ |
||
10 | 10 | $password = $loginField->password; |
11 | 11 | $obLogin = new Login(); |
12 | 12 | $result = $obLogin->authLogin($login, $password); |
13 | - if(isset($result)) |
|
14 | - echo $result; |
|
15 | - else |
|
16 | - echo json_encode([]); |
|
17 | -} |
|
18 | 13 | \ No newline at end of file |
14 | + if(isset($result)) { |
|
15 | + echo $result; |
|
16 | + } else { |
|
17 | + echo json_encode([]); |
|
18 | + } |
|
19 | + } |
|
19 | 20 | \ No newline at end of file |
@@ -5,17 +5,17 @@ |
||
5 | 5 | |
6 | 6 | if(isset($_POST['q'])) |
7 | 7 | { |
8 | - $registerField = json_decode($_POST['q']); |
|
9 | - $name = $registerField->name; |
|
10 | - $email = $registerField->email; |
|
11 | - $username = $registerField->username; |
|
12 | - $mob = $registerField->mob; |
|
13 | - $password = $registerField->password; |
|
14 | - $obRegister = new Register(); |
|
15 | - $result = $obRegister->authRegister($name, $email, $username, $password, $mob); |
|
16 | - if(isset($result)) |
|
17 | - echo $result; |
|
18 | - else |
|
19 | - echo json_encode([]); |
|
8 | + $registerField = json_decode($_POST['q']); |
|
9 | + $name = $registerField->name; |
|
10 | + $email = $registerField->email; |
|
11 | + $username = $registerField->username; |
|
12 | + $mob = $registerField->mob; |
|
13 | + $password = $registerField->password; |
|
14 | + $obRegister = new Register(); |
|
15 | + $result = $obRegister->authRegister($name, $email, $username, $password, $mob); |
|
16 | + if(isset($result)) |
|
17 | + echo $result; |
|
18 | + else |
|
19 | + echo json_encode([]); |
|
20 | 20 | } |
21 | 21 |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require (dirname(__DIR__) . '/vendor/autoload.php'); |
|
3 | +require (dirname(__DIR__).'/vendor/autoload.php'); |
|
4 | 4 | use ChatApp\Register; |
5 | 5 | |
6 | -if(isset($_POST['q'])) |
|
6 | +if (isset($_POST['q'])) |
|
7 | 7 | { |
8 | 8 | $registerField = json_decode($_POST['q']); |
9 | 9 | $name = $registerField->name; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $password = $registerField->password; |
14 | 14 | $obRegister = new Register(); |
15 | 15 | $result = $obRegister->authRegister($name, $email, $username, $password, $mob); |
16 | - if(isset($result)) |
|
16 | + if (isset($result)) |
|
17 | 17 | echo $result; |
18 | 18 | else |
19 | 19 | echo json_encode([]); |
@@ -13,9 +13,10 @@ |
||
13 | 13 | $password = $registerField->password; |
14 | 14 | $obRegister = new Register(); |
15 | 15 | $result = $obRegister->authRegister($name, $email, $username, $password, $mob); |
16 | - if(isset($result)) |
|
17 | - echo $result; |
|
18 | - else |
|
19 | - echo json_encode([]); |
|
20 | -} |
|
16 | + if(isset($result)) { |
|
17 | + echo $result; |
|
18 | + } else { |
|
19 | + echo json_encode([]); |
|
20 | + } |
|
21 | + } |
|
21 | 22 |