Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: norma
- * Date: 20.04.2018
- * Time: 10:40
- */
- echo '<html>
- <head>
- <title>Formular</title>
- </head>
- <body text="#000000" bgcolor="#FFFFFF" link="#FF0000" alink="#FF0000" vlink="#FF0000">
- <form action="login.php" method="post">
- <table >
- <tr>
- <td> E-Mail:</td>
- <td> <input type="Email" name="mail" size="30"></td>
- </tr>
- <tr>
- <td> Passwort:</td>
- <td> <input type="Password" name="pw" size="30"></td>
- </tr>
- </table>
- <input type="Submit" name="login" value="login">
- </form>
- </body>
- </html>';
- if (isset($_POST["pw"])){
- $mail = $_POST["pw"];
- $pw = hash("sha512", $_POST["pw"]);
- $stream = fopen("user.txt", "r");
- while (! feof($stream))
- {
- $zeile = fgetcsv($stream, null, ",");
- $array[]=$zeile;
- }
- foreach ($array as $item){
- if ($item[0] == $mail && $item[5] == $pw){
- $_SESSION["benutzer"] = $item[1];
- echo "Sie sind eingeloggt";
- die;
- }
- }
- echo "Die eingegebenen Daten waren nicht korrekt";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement