Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $verbindung = mysql_connect( "localhost", "******" , "*****" ); mysql_select_db( "m7_studios_de" );
- $username = $_POST["username"];
- $passwort = $_POST["password"];
- $ergebnis = mysql_query("SELECT * FROM accounts WHERE username = '$username' LIMIT 1");
- while($row = mysqli_fetch_object($ergebnis))
- if($row->password == $passwort ){
- $_SESSION["username"] = $username;
- header( "Location: http://www.m7-studios.de/overview.php">
- exit;
- }
- else{
- header( "Location: http://www.m7-studios.de/">
- exit;
- }
- ?>
- <?php
- $verbindung = mysql_connect( "localhost", "******" , "*****" );
- mysql_select_db( "m7_studios_de" );
- $username = $_POST["username"];
- $passwort = $_POST["password"];
- $abfrage = "SELECT username FROM accounts WHERE username='$username' AND password='$password' LIMIT 1";
- $result = mysql_query($abfrage);
- if(mysql_num_rows($result)==1) {
- $_SESSION["username"] = $username;
- header("Location: http://foo.com/logged_in.php");
- die();
- } else {
- header("Location: http://foo.com/index?error=loginfailed");
- die();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement