Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="utf-8">
- <?php require_once("config.php"); ?>
- <title>Giriş</title>
- </head>
- <body>
- <center>
- <form method="post" action="index.php">
- <b>Username</b><br>
- <input type="text" name="loginUser" <br><br>
- <b>Password</b><br>
- <input type="password" name="loginPass" <br><br>
- <input type="submit" name="submit" value="Giriş" >
- </form>
- </center>
- </body>
- </html>
- <?php
- if(isset($_POST["submit"]))
- {
- $user=$_POST["loginUser"];
- $pass=$_POST["loginPass"];
- if(($_POST["loginUser"] == "") and ($_POST["loginPass"]==""))
- {
- echo "bu alanlar boş bırakılamaz";
- exit();
- }
- else
- {
- $sql_check = mysql_query("SELECT * FROM users where username = '$user' and password='$pass' ") or die (mysql_error());
- $pma = mysql_fetch_array($sql_check);
- if(isset($_POST["loginUser"]) and (isset($_POST["loginPass"])))
- {
- if($_POST["loginUser"] == $pma["username"] and ($_POST["loginPass"] == $pma["password"]))
- {
- $_SESSION["login"]= true;
- $_SESSION["username"] = $user;
- header("location:/aba/admin/index.php");
- exit();
- }
- else
- {
- echo "<br>";
- echo "<center>kullanıcı adı veya şifre yanlış lütfen tekrar deneyiniz</center>";
- exit();
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement