rejestracja/index.php

43 lines
1.4 KiB
PHP
Raw Normal View History

2020-12-06 20:15:35 +01:00
<!DOCTYPE html>
<html>
<head>
2021-02-01 22:51:05 +01:00
<link rel="stylesheet" href="style.css">
2020-12-06 20:15:35 +01:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2021-02-27 13:20:49 +01:00
<title>srona głowna</title>
2020-12-06 20:15:35 +01:00
</head>
<body>
2021-01-30 17:10:07 +01:00
<?php
2021-02-27 13:20:49 +01:00
session_start();
2021-01-30 17:10:07 +01:00
$loginErr=$hasloErr=$daneErr="";
$login=$haslo="";
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if (empty($_POST["login"])) {
$loginErr= "login jest wymagany";}
if (empty($_POST["haslo"])) {
$hasloErr= "haslo jest wymagane";}
if ($_POST["login"]=="pacjent"&& $_POST["haslo"]=="pacjent") header("Location: pacjent.php");
2021-02-27 13:20:49 +01:00
else if ($_POST["login"]=="lekarz"&& $_POST["haslo"]=="lekarz") header("Location: lekarz.php");
else if ($_POST["login"]=="recepcjonista"&& $_POST["haslo"]=="recepcjonista") header("Location: recepcjonista.php");
else $loginErr="nieprawidłowe dane";
2021-01-30 17:10:07 +01:00
}
?>
2021-02-20 00:03:15 +01:00
<form method="post" id="formularz1" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
2021-02-01 22:51:05 +01:00
<div id="logowanie">
2021-01-30 17:10:07 +01:00
Login: <input type="text" name="login" value="<?php echo $login;?>">
2021-02-01 22:51:05 +01:00
<span class="error"> <?php echo $loginErr;?></span>
<br><br>
2021-01-30 17:10:07 +01:00
Hasło: <input type="text" name="haslo" value="<?php echo $haslo;?>">
2021-02-01 22:51:05 +01:00
<span class="error"> <?php echo $hasloErr;?></span><br><br>
2021-01-30 17:10:07 +01:00
<input type="submit" name="submit" value="Submit"><br>
<span class="error"> <?php echo $daneErr;?></span><br>
2021-02-01 22:51:05 +01:00
</div>
2020-12-06 20:15:35 +01:00
</form>
</body>
</html>
<?php
?>