Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!isset($_SESSION))
- {
- ob_start();
- session_start();
- }
- $user = $_POST['user'];
- $password = $_POST['password'];
- $_SESSION['user'] = $user;
- $Open = mysql_connect("localhost","ahmada01_ahmada","kxTOIQy4");
- if (!$Open){
- die ("Koneksi ke Engine MySQL Gagal !<br>");
- }
- $Koneksi = mysql_select_db("ahmada01_mahasiswa2");
- if (!$Koneksi){
- die ("Koneksi ke Database Gagal !");
- }
- $sql = "SELECT * FROM admin where user='$user'";
- $qry = mysql_query($sql);
- $num = mysql_num_rows($qry);
- $row = mysql_fetch_array($qry);
- if ($num==0 OR $password!=$row['password']) {
- ?>
- <script language="JavaScript">
- alert('Username atau Password tidak sesuai !');
- document.location='index.php?link=isi.php';
- </script>
- <?php
- }
- else {
- $_SESSION['login']=1;
- header("Location: index.php?link=home.php");
- }
- mysql_close($Open); //Tutup koneksi engine MySQL
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement