-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsorumlu_giris.php
64 lines (57 loc) · 1.92 KB
/
sorumlu_giris.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
include "database.php";
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>E-OKUL</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body class="back">
<?php include "ust_kisayol.php"; ?>
<img src="img/YAVUZLAR-UZUN.jpg" width="800">
<div class="login">
<h1 class="heading">Sorumlu Girişi</h1>
<div class="log">
<?php
if (isset($_POST["login"])) {
$name = $_POST["name"];
$pass = $_POST["pass"];
$sql = "select * from staff where TNAME=?";
$stmt = $db->prepare($sql);
$stmt->bind_param("s", $name);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$storedPass = $row["TPASS"];
if (password_verify($pass, $storedPass)) {
$_SESSION["TID"] = $row["TID"];
$_SESSION["TNAME"] = $row["TNAME"];
echo "<script>window.open('sorumlu_anasayfa.php','_self');</script>";
} else {
echo "<div class='alert alert-danger'>Yanlış Ad Soyad veya Şifre</div>";
}
} else {
echo "<div class='alert alert-danger'>Kullanıcı bulunamadı</div>";
}
}
?>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<div class="form-group">
<label for="name">Ad Soyad</label>
<input type="text" name="name" required class="form-control" id="name">
</div>
<div class="form-group">
<label for="pass">Şifre</label>
<input type="password" name="pass" required class="form-control" id="pass">
</div>
<button type="submit" class="btn btn-primary" name="login">Giriş Yap</button>
</form>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
</body>
</html>