Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. include("connect.php");
  6.  
  7.  
  8.  
  9. $post_username= $_POST['username'];
  10. $post_password= $_POST['password'];
  11. if($post_username && $post_password ){
  12. if(strlen($post_username)>20 || strlen ($post_password)>20){
  13. echo "<font color=\"white\" face='arial'>"."Napaèno uporabniško ime ali geslo"."</font>"."<br>"."<img src='error.png'>";
  14. }else{
  15. $post_password=md5($post_password);
  16. $login =sprintf("SELECT * from USERS WHERE username='%s' and password='%s' ", mysql_real_escape_string($post_username),mysql_real_escape_string($post_password));
  17.  
  18. $rowcount=mysql_num_rows(mysql_query($login));
  19. if($rowcount ==1){
  20. $_SESSION['user']=$post_username;
  21.  if (!isset($_GET['reload'])) {
  22. echo '<meta http-equiv=Refresh content="0;url=index2.php?reload=1">';
  23. }
  24.  
  25. }else{
  26. echo "<font color=\"white\" face='arial'>"."Napaèno uporabniško ime ali geslo"."</font>"."<br>"."<img src='error.png'>";
  27.  
  28.  
  29.  
  30. }
  31. }
  32. }else{
  33. echo "<font color=\"white\"face='arial'>"."Obe polji morata biti vnešeni!"."</font>"."<br>"."<img src='error.png'>";
  34.  
  35. }
  36.  
  37. ?>
  38.  
  39. <br>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement