Guest User

Untitled

a guest
Jul 4th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. <?
  2. class Lognout {
  3.  
  4. function formularZobrazit() {
  5. echo' <form name="form1" method="post" action="">
  6. <td
  7. <td colspan="3">Login Game char </td> <br> <br>
  8. <tr>
  9. <td colspan="3">Lognout</td> <br>
  10. </tr>
  11. <tr>
  12. <td width="294"><input name="login" type="text" size="10" id="login"><br></td>
  13. </tr>
  14. <tr>
  15. <td>Password</td> <br>
  16. <td></td>
  17. <td><input name="heslo" type="password" size="10" id="heslo"></td>
  18. </tr>
  19. <tr>
  20. <td>&nbsp;</td>
  21. <td>&nbsp;</td> <br>
  22. <td><input type="submit" name="Submit" value="Lognout"></td>
  23. </tr>
  24. </td>
  25. </form>';
  26. }
  27.  
  28.  
  29.  
  30.  
  31. ///////////////function overeniHesla()////////////////////
  32. function overeniHesla() {
  33. $this->login = $_POST['login'];
  34. //$this->login;
  35. $this->heslo = $_POST['heslo'];
  36. //$this->heslo;
  37. if (!empty($this->login)){
  38. $passcode = base64_encode(pack('H*', sha1($this->heslo)));
  39. $radku= dibi::query('SELECT count(*) FROM `accounts` WHERE `login` = %s', $this->login, 'and `password` = %s', $passcode )->fetchSingle(); //POZOR NA fetchSingle
  40.  
  41. print "AAAAAAaaa";
  42. print "<br>hash heslo:";
  43. print "$passcode";
  44. }
  45. }
  46. //////////////////////////////////////////////////
  47.  
  48.  
  49. ///////////////function test()////////////////////
  50. function test() {
  51. print " $this->heslo ";
  52. print "---dasdasdasdas";
  53. }
  54. //////////////////////////////////////////////////
  55.  
  56.  
  57.  
  58.  
  59.  
  60. ///////////////function hesloTrue()////////////////////
  61. function hesloTrue() {
  62. $this->login = $_POST['login'];
  63. //$this->login;
  64. $this->heslo = $_POST['heslo'];
  65. //$this->heslo;
  66. print "$this->test()";
  67. if (!empty($this->login)){
  68. $passcode = base64_encode(pack('H*', sha1($this->heslo)));
  69. $radku= dibi::query('SELECT count(*) FROM `accounts` WHERE `login` = %s', $this->login, 'and `password` = %s', $passcode )->fetchSingle(); //POZOR NA fetchSingle
  70.  
  71.  
  72.  
  73.  
  74.  
  75. print "<br>hash heslo:";
  76. print "$passcode";
  77. }
  78. }
  79. //////////////////////////////////////////////////
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. function zobrazPolozku($hoj) {
  97. $this->hoja = $hoj;
  98. print $this->hoja;
  99.  
  100. }
  101.  
  102. }
  103.  
  104. $hlavni_menu = new Lognout();
  105. $hlavni_menu->formularZobrazit();
  106. $hlavni_menu->overeniHesla();
  107. $hlavni_menu->test();
  108. $hlavni_menu->zobrazPolozku('hojjghgfhfg');
Advertisement
Add Comment
Please, Sign In to add comment