Posted by Anonymous Mon 12th Mar 2007 07:46 - Syntax is PHP - 139 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers
PHP parser reported no syntax errors in this post!
  1. //main
  2. if ($_SESSION['is_admin'] == 1) {
  3.     echo "logged in! \"../logout/\">logout ";
  4. }
  5. else {
  6.     echo "not logged!";
  7. }
  8. ?>
  9.  
  10.  
  11. /* logout */ session_start(); session_destroy(); header("Location: ../login"); ?>
  12.  
  13. // login success script
  14. include ('../../db/database.php');
  15. $escape_user = mysql_real_escape_string($_POST['user']);
  16. $escape_password = mysql_real_escape_string($_POST['password']);
  17. $query = "SELECT COUNT(*) FROM users WHERE user = '$escape_user' AND password=password('$escape_password');";
  18. $result = mysql_query($query);
  19. if (mysql_result($result, 0) == 1) {
  20.     session_start();
  21.     $_SESSION['is_admin'] = 1;
  22.     header("Location: ../../main/");
  23. }
  24. else {
  25.     // error message here.
  26. }
  27. ?>
  28.  

PermaLink to this entry https://pastebin.co.uk/11710
Posted by Anonymous Mon 12th Mar 2007 07:46 - Syntax is PHP - 139 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers

 

Comments: 0