Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $id_user=sess("id_user");
- if($id_user){
- redirect("index.php");
- return false;
- };
- ?>
- <div class="tabel-login" id="tabel-login">
- <a href="index.php"><div class="out"><h6 class="h6-out">keluar</h6></div></a>
- <form class="form-login" method="post">
- <label>Username :</label><br>
- <input type="text" name="username" class="in-login" required="required"><br>
- <label>Password :</label><br>
- <input type="password" name="pass" class="in-login" ><br>
- <input type="submit" value="Login" name="btn-login" class="btn-login">
- </form>
- <?php
- if(isset($_POST["btn-login"])){
- extract($_POST);
- $pass=md5($pass);
- $select=select("user where username='$username' or password='$pass'");
- if(nur($select)>0){
- $hasil=fetc($select);
- if($hasil["status"]=="Belum aktif"){
- alert("Maaf.! Moho tunggu pengaktifan akun anda.");
- }else{
- $_SESSION["id_user"]=$hasil["id_user"];
- $_SESSION["username"]=$hasil["username"];
- $_SESSION["email"]=$hasil["email"];
- $url=get("url");
- if($url)redirect("?hal=$url");
- else redirect("index.php");
- }
- }
- else
- {
- alert("email atau password salah");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement