Dodanie ekranu logowania, do zrobienia połączyć to z poprzednim projektem z lekcji 2
This commit is contained in:
1 parent
83672909f4
commit
c198d9d70a
12 files changed
+351
No files matched your search
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
// admin hasło admin
|
||||
// worker hasło worker
|
||||
// user hasło user
|
||||
|
||||
session_start();
|
||||
if(isset($_SESSION['logged'])) {
|
||||
header("Location: ./");
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Projekt</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: Arial;
|
||||
}
|
||||
body {
|
||||
background-color: cornflowerblue;
|
||||
}
|
||||
form {
|
||||
border: 1px solid black;
|
||||
margin: 1em auto;
|
||||
width: fit-content;
|
||||
padding: 1em;
|
||||
background-color: beige;
|
||||
box-shadow: 5px 5px 0px black;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
margin-bottom: .25em;
|
||||
}
|
||||
h1 + p {
|
||||
text-align: center;
|
||||
margin-bottom: .25em;
|
||||
}
|
||||
.cred-container {
|
||||
width: 100%;
|
||||
clear: both;
|
||||
}
|
||||
.cred-container > label {
|
||||
float: left;
|
||||
margin: .5em 0;
|
||||
}
|
||||
.cred-container > input {
|
||||
float: right;
|
||||
margin: .5em 0;
|
||||
}
|
||||
|
||||
input[type='text'] {
|
||||
width: 50%;
|
||||
}
|
||||
input[type='password'] {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
input[type='submit'] {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
margin: .5em 0;
|
||||
margin-bottom: 0;
|
||||
padding: .5em;
|
||||
}
|
||||
|
||||
hr {
|
||||
margin-bottom: .25em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form action="validate.php" method="post">
|
||||
<h1>SIEMANDEROOO</h1>
|
||||
<p>No bo ogólnie to tu mamy takie tajne dane pliki <s>epsztajna</s><br>i fajnie by było jakbyś się zalogował żeby to zobaczyć...</p>
|
||||
<hr>
|
||||
<?php
|
||||
if(isset($_GET['error'])) {
|
||||
echo '<span style="font-style: oblique; color: red;">Nieprawidłowa nazwa użytkownika lub hasło!</span><br>';
|
||||
}
|
||||
?>
|
||||
<div class='cred-container'>
|
||||
<label>username:</label><input type="text" name="username" id="username">
|
||||
</div>
|
||||
<div class='cred-container'>
|
||||
<label>hasło:</label><input type="password" name="password" id="password">
|
||||
</div><br>
|
||||
<input type="submit" value="Zaloguj">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in new issue
Block a user