Guest User

Untitled

a guest
Jul 4th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
  52. print " $this->heslo ";
  53. print "---dasdasdasdas";
  54. }
  55. //////////////////////////////////////////////////
  56.  
  57.  
  58.  
  59.  
  60.  
  61. ///////////////function hesloTrue()////////////////////
  62. function hesloTrue() {
  63. $this->login = $_POST['login'];
  64. //$this->login;
  65. $this->heslo = $_POST['heslo'];
  66. //$this->heslo;
  67. $this->test();
  68. print "$this->test()";
  69. if (!empty($this->login)){
  70. $passcode = base64_encode(pack('H*', sha1($this->heslo)));
  71. $radku= dibi::query('SELECT count(*) FROM `accounts` WHERE `login` = %s', $this->login, 'and `password` = %s', $passcode )->fetchSingle(); //POZOR NA fetchSingle
  72.  
  73.  
  74.  
  75.  
  76.  
  77. print "<br>hash heslo:";
  78. print "$passcode";
  79. }
  80. }
  81. //////////////////////////////////////////////////
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98. function zobrazPolozku($hoj) {
  99. $this->hoja = $hoj;
  100. print $this->hoja;
  101.  
  102. }
  103.  
  104. }
  105.  
  106. $hlavni_menu = new Lognout();
  107. $hlavni_menu->formularZobrazit();
  108. $hlavni_menu->overeniHesla();
  109. //$hlavni_menu->test();
  110. $hlavni_menu->zobrazPolozku('hojjghgfhfg');
Advertisement
Add Comment
Please, Sign In to add comment