Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <form action="login.php" method="post">
- Dein Username:<br>
- <input type="text" size="24" maxlength="50"
- name="username"><br><br>
- Dein Passwort:<br>
- <input type="password" size="24" maxlength="50"
- name="password"><br>
- <input type="submit" value="Login">
- </form>
- </body>
- </html>
- <?php
- session_start();
- if(isset($_POST['username'], $_POST['password'])) {
- $verbindung = mysql_connect("localhost", "root" , "-----------------")
- or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
- mysql_select_db("DATENBANKNAMEN") or die ("Datenbank konnte nicht ausgewählt werden");
- $username = $_POST["username"];
- $passwort = md5($_POST["password"]);
- $abfrage = "SELECT username, passwort FROM TABELLENNAME WHERE username LIKE '$username' LIMIT 1";
- $ergebnis = mysql_query($abfrage);
- $row = mysql_fetch_object($ergebnis);
- if($row-> SPALTENNAME == '1') {
- echo "<meta http-equiv=\"refresh\" content=\"3; URL=>GUT.php\">";
- } else {
- echo "<meta http-equiv=\"refresh\" content=\"3; URL=SCHLECHT.php\">";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement