auth.php
Upload User: aini292
Upload Date: 2017-05-03
Package Size: 91k
Code Size: 1k
Category:

Search Engine

Development Platform:

PHP

  1. <?php 
  2. error_reporting(E_ERROR | E_PARSE);
  3. $admin = "admin";
  4. $admin_pw = "admin";
  5. session_start();
  6. if (isset($_POST['user']) && isset($_POST['pass'])) {
  7. $username = $_POST['user'];
  8. $password = $_POST['pass'];
  9. if (($username == $admin) && ($password ==$admin_pw)) {
  10. $_SESSION['admin'] = $username;
  11. $_SESSION['admin_pw'] = $password;
  12. }
  13. header("Location: admin.php");
  14. } elseif ((isset($_SESSION['admin']) && isset($_SESSION['admin_pw']) &&$_SESSION['admin'] == $admin && $_SESSION['admin_pw'] == $admin_pw ) || (getenv("REMOTE_ADDR")=="")) {
  15. } else {
  16. ?>
  17. <html>
  18. <head>
  19. <title>Sphider Admin Login</title>
  20. <LINK REL=STYLESHEET HREF="admin.css" TYPE="text/css">
  21. </head>
  22. <body>
  23. <center>
  24. <br><br>
  25. <fieldset style="width:30%;"><legend><b>Sphider Admin Login</b></legend>
  26. <form action="auth.php" method="post">
  27. <table>
  28. <tr><td>Username</td><td><input type="text" name="user"></td></tr>
  29. <tr><td>Password</td><td><input type="password" name="pass"></td></tr>
  30. <tr><td></td><td><input type="submit" value="Log in" id="submit"></td>
  31. </tr></table>
  32. </form>
  33. </fieldset>
  34. </center>
  35. </body>
  36. </html>
  37. <?php 
  38. exit();
  39. }
  40. $settings_dir = "../settings";
  41. include "$settings_dir/database.php";
  42. ?>