Advertisement
galovikCode

Untitled

Apr 22nd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1.  
  2. <?
  3. $host="hrasko.eu";
  4. $username="c1_acadmins";
  5. $password="hcdpUNW_68";
  6. $db_name="c1_acadmins";
  7. $table="members";
  8.  
  9. mysql_connect($host, $username, $password, $db_name);
  10. mysql_select_db($db_name);
  11.  
  12. // username and password sent from Form
  13. $myusername=mysql_real_escape_string($_POST['username']);
  14. $mypassword=mysql_real_escape_string($_POST['password']);
  15. if(isset($myusername) && isset($mypassword)) {
  16.  
  17. $sql="SELECT FROM ".$table." WHERE username='$myusername' and password='$mypassword'";
  18. $result=mysql_query($sql);
  19. $count=mysql_num_rows($result);
  20.  
  21. if($count==2)
  22. {
  23. session_register($myusername);
  24. $_SESSION['login_user']=$myusername;
  25.  
  26. header("locations: login_success.php");
  27. }
  28.  
  29. else
  30. {
  31. echo 'TENTO KOD PRESIEL';
  32.  
  33.  
  34. }
  35. }else{
  36. echo 'Zadajte meno a heslo';
  37. }
  38.  
  39.  
  40.  
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement