Skip to content
Snippets Groups Projects
Commit 4adec2fa authored by Dzarrrr's avatar Dzarrrr
Browse files
parents ca1b1952 77bf57bb
No related merge requests found
images/edit.png

27.7 KiB

images/mail.png

17.7 KiB

images/phone.png

22.7 KiB

images/star.png

17.4 KiB

......@@ -18,7 +18,7 @@
</div>
<div class="space1"></div>
<div class="containerform">
<form action="loginserver.php" method="POST">
<form action="login.php" method="POST">
<label>Username</label>
<input type="text" placeholder="Enter Username" name="uname" required>
......
<!DOCTYPE html>
<html>
<head>
<title>Laman Login</title>
<link rel="stylesheet" type="text/css" href="login.css">
<link href="https://fonts.googleapis.com/css?family=Oswald:600" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lora" rel="stylesheet">
</head>
<body>
<div class="containerlogin">
<div class="wraplogin">
<div class="activity">
<span class="makeline">
LOGIN
</span>
</div>
</div>
<div class="space1"></div>
<div class="containerform">
<form action="login.php" method="POST">
<label>Username</label>
<input type="text" placeholder="Enter Username" name="uname" required>
<div class="space3"></div>
<label>Password</label>
<input type="password" placeholder="Enter Password" name="psw" required>
<div class="space2"></div>
<div class="noaccount">
<a href="register.php" id="linkRegister">Don't have an account?</a>
</div>
<div class="containerbutton">
<button type="submit" name="submit">GO!</button>
</div>
</form>
</div>
</div>
</body>
</html>
<?php
if (isset($_POST['submit'])) {
if (empty($_POST['uname']) || empty($_POST['psw'])) {
echo "<script>alert('Username or Password is Invalid!')</script>";
}
else {
$uname=$_POST['uname'];
$psw=$_POST['psw'];
$conn = new mysqli("localhost", "root", "", "projek_db");
$sql = "SELECT * FROM users WHERE uname='$uname' limit 1";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row=mysqli_fetch_assoc($result)) {
$id = $row["id"];
$pswconfirm = $row["psw"];
}
if ($psw === $pswconfirm) {
header("Location: profile.php?id_active=". $id);
} else {
echo "<script>alert('Wrong password!')</script>";
exit;
}
} else {
echo "<script>alert('Username not exist!')</script>";
exit;
}
mysqli_close($conn);
}
}
?>
\ No newline at end of file
.profile-wrapper {
width: 500px;
font-size: 0;
margin-left:auto;
margin-right:auto;
padding: 5px;
}
.my-profile {
display: inline-block;
font-size: 2rem;
width: 95%;
font-family: 'Oswald', sans-serif;
}
.edit-image {
display: inline-block;
height: 5%;
width: 5%;
vertical-align: top;
}
.icon {
display: inline-block;
height: 5%;
width: 5%;
vertical-align: text-bottom;
}
.profile-content {
font-size: initial;
text-align: center;
}
.profile-image {
display: inline-block;
height: 115px;
width: 115px;
border-radius: 50%;
border: 7px solid #000000;
}
.profile-username {
font-size: 1.5rem;
display: block;
font-weight: bold;
font-family: 'Oswald', sans-serif;
}
.personal-data {
}
.vote {
}
.preferred-locations-wrapper {
font-size: 0;
margin-top: 15px;
}
.preferred-locations-list {
font-size: initial;
}
.preferred-locations {
display: inline-block;
font-size: 2rem;
width: 95%;
font-family: 'Oswald', sans-serif;
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<?php
echo '
<link rel="stylesheet" href="profile.css" />
<link itemprop="url" href="https://fonts.googleapis.com/css?family=Oswald:600" rel="stylesheet">
<div class="profile-wrapper">
<span class="my-profile">
MY PROFILE
</span>
<img class="edit-image" src="../images/edit.png" />
<div class="profile-content">
<img class="profile-image" src="../images/ash_ketchum.png">
<span class="profile-username">@kukuhbr</span>
<div class="personal-data">
<span class="fullname">Kukuh Basuki Rahmat</span><br>
<span class="user-type">Driver | </span>
<img class="icon" src="../images/star.png" />
<span class="vote">5</span>
<span class="voter"> (17823 voters)</span><br>
<img class="icon" src="../images/mail.png" />
<span class="email">kukuhis777@gmail.com</span><br>
<img class="icon" src="../images/phone.png">
<span class="phone-number">08193232050</span><br>
</div>
</div>
<div class="preferred-locations-wrapper">
<span class="preferred-locations">
PREFERRED LOCATIONS:
</span>
<img class="edit-image" src="../images/edit.png" />
<ul class="preferred-locations-list">
<li>Pewter City</li>
<li>Saffron City</li>
<li>Skypillar Tower</li>
</ul>
</div>
</div>
'
?>
\ No newline at end of file
......@@ -53,7 +53,7 @@
<input align = "left" type = "checkbox" name = "signAsDriver" value = "1"> Also sign me up as a driver! <br>
</div>
<div class = "containerLogin">
<a href = "login.html" id = "linkLogin">Already have an account?</a>
<a href = "login.php" id = "linkLogin">Already have an account?</a>
</div>
<div class = "containerButton">
<button type = "submit" name="submit">REGISTER</button>
......
<!-- Notes : Masih bisa dirapiin inline cssnya -->
<!DOCTYPE HTML>
<html>
<head>
<title>Laman Register</title>
<link rel = "stylesheet" type="text/css" href="register.css">
<link href="https://fonts.googleapis.com/css?family=Oswald:600" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lora" rel="stylesheet">
</head>
<body>
<div class = "containerLuar">
<div class = "styleactivity">
<div class = "activity">
<span class = "makeline">
SIGN UP
</span>
</div>
</div>
<form class = "contentForm" class = "space1" name="registrasi" method="POST" action="connect_registrasi_db.php">
<div class = "container">
<div class = "containerTabel">
<table style = "padding-top:2px" style = "padding-bottom:1px" style = "width:100%">
<tr class = "tablerow">
<td align = "left" class = "tablecolumnleft"> Your Name </td>
<td class = "tablecolumnright" align = "right"> <input style = "width:100%" class = "inputForm" type = "text" placeholder="Nama anda" name = "userRealName" required align = "right"> </td>
</tr>
<tr class = "tablerow">
<td align = "left" class = "tablecolumnleft"> Username </td>
<td class = "tablecolumnright" align = "right"><input style = "width:100%" class = "inputForm" input type = "text" placeholder="Username" name = "uname" required class = "registerForm"> </td>
</tr>
<tr class = "tablerow">
<td align = "left" class = "tablecolumnleft"> Email </td>
<td class = "tablecolumnright" align = "right"> <input style = "width:100%" class = "inputForm" input type = "text" placeholder = "E-mail" name = "email" required class = "registerForm"> </td>
</tr>
<tr class = "tablerow">
<td align = "left" class = "tablecolumnleft"> Password </td>
<td class = "tablecolumnright" align = "right"> <input style = "width:100%" class = "inputForm" input type = "password" placeholder = "Passsword" name = "psw" required class = "registerForm"> </td>
</tr>
<tr class = "tablerow">
<td align = "left" class = "tablecolumnleft"> Confirm Password </td>
<td class = "tablecolumnright" align = "right"> <input style = "width:100%" class = "inputForm" input type = "password" placeholder = "Confirm Password" name = "confpsw" required class = "registerForm"> </td>
</tr>
<tr class = "tablerow">
<td align = "left" class = "tablecolumnleft"> Phone Number </td>
<td class = "tablecolumnright" align = "right"> <input style = "width:100%" class = "inputForm" input type = "text" placeholder = "Phone Number" name = "phoneNumber" required class = "registerForm"> </td>
</tr>
</table>
</div>
<div class="containerCheckbox">
<input type = "hidden" name = "signAsDriver" value = "0">
<input align = "left" type = "checkbox" name = "signAsDriver" value = "1"> Also sign me up as a driver! <br>
</div>
<div class = "containerLogin">
<a href = "login.php" id = "linkLogin">Already have an account?</a>
</div>
<div class = "containerButton">
<button type = "submit" name="submit">REGISTER</button>
</div>
</div>
<form>
</div>
</body>
</html>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment