-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
112 lines (106 loc) · 3.75 KB
/
index.php
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
session_start();
if (isset($_SESSION['login_id'])) {
header('location:chat/');
die();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Login | Voitext Chat</title>
<meta name="author" content="Dwarkesh Purohit">
<meta name="keywords" content="online chat application, voice to text chat app, web based chat application, javascript chat application, speech recognition chat application, speech recognition api, login to voitext, voitext chat application, voice to text chat application">
<meta name="description" content="Web based chat application developed with speech recognition javascript api, in which user can send messages by typing and also by speaking sentence.">
<meta property="og:image" itemprop="image primaryImageOfPage" content="https://charotaritsolutions.com/assets/img/CIS-logo.png" />
<link rel="shortcut icon" href="https://charotaritsolutions.com/assets/img/CIS-logo.png">
<link rel="stylesheet" type="text/css" href="assets/bootstrap-4.4.1-dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/fontawesome-free-5.13.0-web/css/all.min.css">
<style type="text/css">
body {
font-family: rockwell;
}
div#login {
width: auto;
border: 2px solid black;
box-shadow: 2px 3px 4px 9px grey;
padding: 25px;
box-sizing: border-box;
}
label {
font-weight: bold;
color: black;
}
input[type=text] {
font-weight: bold;
color: #543;
}
button {
font-weight: bold !important;
}
</style>
</head>
<body>
<div class="row">
<div class="container col-md-12 mt-5" align="center">
<h3>Voitext Login <i class="fa fa-lock"></i></h3>
</div>
<div class="container col-md-5" id="login">
<div class="form-group">
<label>Username</label>
<input type="text" name="username" class="form-control" placeholder="Enter your username" autocomplete="off" required>
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="password" class="form-control" placeholder="Enter your password" autocomplete="off" required>
</div>
<div class="form-group">
<button class="btn btn-outline-dark">Login</button>
</div>
</div>
<div class="col-md-12 mt-5" align="center">
<h4>Developed by @Charotar IT Solutions</h4>
<h6>All rights are reserved to Charotar IT Solutions</h6>
</div>
</div>
<script type="text/javascript" src="assets/bootstrap-4.4.1-dist/js/jquery.min.js"></script>
<script type="text/javascript" src="assets/bootstrap-4.4.1-dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/bootstrap-4.4.1-dist/js/sweetalert.min.js"></script>
<script type="text/javascript" src="assets/fontawesome-free-5.13.0-web/js/all.min.js"></script>
</body>
<script type="text/javascript">
$(document).ready(function(){
$("button").on("click", function(){
var username = $("input[name=username]").val();
if (username.length == 0) {
$("input[name=username]").focus();
return false;
}
var password = $("input[name=password]").val();
if (password.length == 0) {
$("input[name=password]").focus();
return false;
}
if (username.length > 0 && password.length > 0) {
$.post('server/main.php', {cmd:'login', username: username, password: password}, function(response){
console.log(response);
var obj = JSON.parse(response);
if (obj['type'] == 'error' || obj['type'] == 'warning') {
swal(obj['msg'],'',obj['type']);
}
else {
swal('Success', 'Welcome to Voitext Chat', 'success').then((value)=>{
window.location = 'chat/';
});
}
});
}
else {
swal('Enter value', 'Please fill the login credentials carefully!', 'error');
}
});
});
</script>
</html>