Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2. ob_start();
  3. session_start();
  4. include 'config2.php';
  5. ?>
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <div align="center" style="font: 12px Verdana;"><br />
  8. <?php
  9. $_SESSION['username'] = $_POST['username'];
  10. $_SESSION['password'] = $_POST['password'];
  11. $username = $_SESSION['username'];
  12. $password = md5($_SESSION['password']);
  13. $leshdale = $_POST['username'];
  14. $justchecking = mysql_query("SELECT * FROM users WHERE nickname = '$username' and password = '$password'");
  15. $login = $_POST['login'];
  16. $probaedno = time();
  17.     if(isset($login)) {
  18.         if (mysql_fetch_row($justchecking) > 0) {
  19.         // mysql_query("DELETE FROM online WHERE name='".$_SESSION['username']."'");
  20.         mysql_query("INSERT INTO online (name, timestamp) VALUES ('$username', '$probaedno')");
  21.         mysql_query("DELETE FROM online WHERE timestamp < time() + 1");
  22.         header("Location: p.php?page=home");
  23.         echo 'Редактирай профил <br /> ';
  24. }
  25. else {
  26. echo 'Грешно потребителско име или парола.';
  27. session_destroy();
  28. header('refresh: 1; url=p.php?page=home');
  29. }
  30. }
  31. else {
  32.     include_once 'form.php';
  33. }
  34. ?>
  35. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement