daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Apr 27th, 2016 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. session_start();
  3. include("konekcija_na_bazu.php");
  4. if(!empty($_POST['username']) and !empty($_POST['password'])){
  5.  
  6. $username = mysql_real_escape_string($_POST['username']);
  7. $password = md5(mysql_real_escape_string($_POST['password']));
  8. $checklogin = mysql_query("SELECT * FROM members WHERE username = '".$username."' AND password = '".$password."'");
  9.  
  10. if(mysql_num_rows($checklogin) == 1){
  11. $_SESSION['login'] = $username;
  12. header("location:home.php");
  13. }
  14.  
  15. else{
  16. echo "<h1>Greska</h1>";
  17. echo "<p>Klikni na <a href=\login1.php\>i probajte ponovo</a></p>";
  18. }
  19.  
  20. }
  21. else{
  22. ?>
  23. <html>
  24. <body>
  25. <h1>Login</h1>
  26. <p>Hvala na posjeti! Logirajte se</p>
  27. <form action="login1.php" method="POST">
  28. <b>username:</b><input type="text" name="username" id="username"></br>
  29. <b>password:</b><input type="password" name="password" id="password"></br>
  30. <input type="submit" value="login"><input type="reset" value="Obrisi">
  31. </form>
  32. </body>
  33. </html>
  34. <?php
  35. }
  36. ?>
  37.  
  38. <html>
  39. <body>
  40. </hr>
  41. <a href="registration_form.php">registracija</a>
  42. </body>
  43. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top