login.php 416 B

1234567891011121314
  1. <?php
  2. $doc_root = $_SERVER["DOCUMENT_ROOT"] . "/";
  3. include $doc_root . "functions.php";
  4. $con = start_db();
  5. $user = mysqli_real_escape_string($con, $_POST["user"]);
  6. $pass = mysqli_real_escape_string($con, $_POST["pass"]);
  7. $pass = sha1($pass);
  8. if (login($con, $user, $pass)){
  9. header("Location: /index.php");
  10. }
  11. else{
  12. header("Location: /authentication.php");
  13. }
  14. ?>