Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // mysql_config.php
- <?php
- // MYSQL Konfigurationsdatei
- mysql_connect("localhost",
- "root","","infected_s1");
- ?>
- //login.html - nur das formular
- <form action="login.php" method="post">
- <p>Username:
- <input name="username" type="text" id="username"/>
- </p>
- <p>Password: <input name="password" type="password" id="password"/>
- </p>
- <p> </p>
- <p>
- <input type="submit" name="submit" id="submit" value="Login" />
- </p>
- <p> <br />
- </p>
- </form></p>
- // login.php
- <?php
- include('include/mysql_config.php');
- $username = htmlspecialchars($_POST['username']);
- $password = htmlspecialchars(md5($_POST['password']));
- if (empty($username) or empty($password)) {
- echo 'Es wurde nichts eingegeben<br><a href="login.html">Zurück</a>';
- }
- $sql_loginabfrage ="SELECT * FROM `user` WHERE `Username` = '" . $username . "' AND `Password` = '" .$password . "'";
- if(mysql_query($sql_loginabfrage) == true) {
- echo 'Du bist erfolgreich eingeloggt als: ' . $username;
- } else {
- echo 'Benutzerdaten oder Kennwort falsch. Bitte überprüfen Sie ihre Eingaben';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement