<!
DOCTYPE html>
<html lang="en">
<head>
<body>
<meta charset="UTF-8">
<meta http-equiv="x-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>KEHADIRAN DEWAN PERDANA</title>
<link rel="stylesheet"
href="[Link]
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/
Dwwykc2MPK8M2HN" crossorigin="anonymous">
</body>
</head>
<?php
$hostName = "localhost";
$dbUser = "root";
$dbPassword = "";
$dbName = "dewanperdana";
$conn = mysqli_connect($hostName, $dbUser, $dbPassword, $dbName);
if (!$conn) {
die("Something went wrong;");
}
// Create connection
$connection = new mysqli($hostName, $dbUser, $dbPassword, $dbName);
//add mew client to database
$sql ="INSERT INTO login_signup (USERNAME, PASSWORD)".
"VALUES ('$USERNAME', '$PASSWORD')";
$result = $connection->query($sql);
if (!$result){
$errorMessage = "Invalid query;" . $connection->error;
break;
}
?>
<style>
body{
background-image:
url('[Link]
design_53876-[Link]?
size=626&ext=jpg&ga=GA1.1.1803636316.1700611200&semt=ais');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
height: 100vh;
margin: 0vh;
display: flex;
justify-content: center;
align-items: center;
}
</style>
<head>
<body>
<h1 style="text-align: center; font-size: 50px;">KEHADIRAN DEWAN
PERDANA</h1>
<form id="LoginForm">
<p style="text-align: center; font-size: 20px;">
<label for="username">USERNAME</label>
<input type="text" id="username" name="username" required>
</p>
<p style="text-align: center; font-size: 20px;">
<label for="password">PASSWORD</label>
<input type="password" id="password" name="password" required>
</p>
<p style="text-align: center;">
<button type="button" onclick="attemptLogin()">LOGIN</button>
</p>
<p style="text-align: center;">
<button type="button" onclick="[Link]='[Link]'">SIGN
UP</button>
</form>
</body>
</head>
<script>
function attemptLogin() {
var username = [Link]("username").value;
var password = [Link]("password").value;
if ([Link]() ==="" || [Link]() ===""){
alert("Please enter both username and password");
return;
}
[Link]="[Link]";
[Link]("USERNAME" + username);
[Link]("PASSWORD" + password);
</script>
</html>