Advertisement
galovikCode

Untitled

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