PHP code

<?php
ob_start
();
session_start();

include 
"sql_and_php_debug_with_anticheat.php";
mysql_connect("localhost""level37""GJ2FaWfrYUfyFcCXsyIvIA==");
mysql_select_db("level37");

?>
<h1>Login by hand (e.g. under 'admin' : 'admin')</h1>
Flag is in `flag`.flag, it is a 7-digit number. Like level 35, but you can't use SQLmap this time.<br/>
(you can check if SQL query returned TRUE or FALSE (login OK or NOT ok). Can you get data from DB using that?)<br/><br/>
<?php
if (isset($_SESSION['loggedIn'])) {
  if (isset(
$_GET['logout'])) {
    unset(
$_SESSION['loggedIn']);
    
ob_end_clean();
    
header("Location: ?"true302);
    exit;
  }

  echo 
"Welcome, user! The page is under construction<p/><a href='?logout&sig_logout'>Log out &raquo;</a>";
} else {
  if (isset(
$_POST['login'])) {
    
$login $_POST['login'];
    
$password $_POST['password'];
    
$res debug_mysql_query("SELECT * FROM users WHERE login = '$login' AND password = '$password'");
    if (
mysql_num_rows($res) > 0) {
      
$_SESSION['loggedIn'] = true;
      
ob_end_clean();
      
header("Location: ?"true302);
      exit;
    } else {
      echo 
"Bad username or password! Hope this does not give you information you need ;)";
    }
  }

?>
<form method="POST" id="form">Login: <input type="text" name="login" id="login" /><br/>
Password: <input type="password" name="password" id="password" /><br/>
<input type="submit" value="Login &raquo;" />
<input type="hidden" name="sig_login" id="sig_login" />
<input type="hidden" name="sig_password" id="sig_password" />
</form>
<?php
}
SQL debug

Login by hand (e.g. under 'admin' : 'admin')

Flag is in `flag`.flag, it is a 7-digit number. Like level 35, but you can't use SQLmap this time.
(you can check if SQL query returned TRUE or FALSE (login OK or NOT ok). Can you get data from DB using that?)

Login:
Password: