-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
31 lines (23 loc) · 710 Bytes
/
index.php
File metadata and controls
31 lines (23 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require 'api/callApi.php';
include 'front/req_header.php';
include 'front/temp_header.php';
include 'front/form_login.php';
include 'front/temp_footer.php';
if(isset($_POST['loginBtn'])){
$username = $_POST['username'];
$response=callLogin($username);
checkResponse($response);
if($response->status==201){
$response=callRegister($username);
checkResponse($response);
}
$myUserId=$response->userId;
$response=callGetUserFromId($myUserId);
checkResponse($response);
session_start();
$_SESSION['myUserId']=$response->user->id;
$_SESSION['myName']=$response->user->name;
header('Location: '.'/LocalNetworkChat/dashboard.php');
}
?>