Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] opcje po zalogowaniu a index.php
gigzorr
post
Post #1





Grupa: Zarejestrowani
Postów: 652
Pomógł: 47
Dołączył: 6.02.2010
Skąd: Radom

Ostrzeżenie: (0%)
-----


witam. po zalogowaniu mam opcje w lewym górnym rogu jak na ssie:
http://yfrog.com/f/n785384331j/

jak klikne na index.php to juz ich tam nie ma , a chce zeby byly , sesji napewno nie trace bo jak klikne na zaloguj sie to sa opcje .
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
gigzorr
post
Post #2





Grupa: Zarejestrowani
Postów: 652
Pomógł: 47
Dołączył: 6.02.2010
Skąd: Radom

Ostrzeżenie: (0%)
-----


ale co mam podać skrypt logowania?

  1.  
  2. <?php session_start();
  3.  
  4. $db = mysql_connect("","1","2") or die(mysql_error());
  5.  
  6.  
  7. if(is_numeric($_SESSION['UserId']))
  8.  
  9. {
  10. if($_SESSION['UserStatus'] == 1)
  11. {
  12. $sBufor .= "<div style='text-decoration:none;font-family:Georgia;color:black;font-size:13px;'>Witaj administratorze";
  13. $sBufor .= ''.$_SESSION['zalogowany_user_login'].' zostałeś/aś pomyślnie zalogowany/a.<br/>';
  14. $sBufor .= '<br/>';
  15. $sBufor .= '<a href="index.php?page=dodajnewsa" class="xx">Dodaj Newsa</a>';
  16. $sBufor .= '<br/>';
  17. $sBufor .= '<a href="index.php?page=edytuj" class="xx">Edytuj Newsa</a>';
  18. $sBufor .= '<br/>';
  19. $sBufor .= '<a href="index.php?page=usun" class="xx">Usun Newsa</a>';
  20. $sBufor .= '<br/>';
  21. $sBufor .= '<a href="index.php?page=wiadomosci" class="xx">Zobacz zamówienia!</a>';
  22. $sBufor .= '<br/>';
  23. $sBufor .= '<a href="index.php?page=zmianapw" class="xx">Zmien Haslo</a>';
  24. $sBufor .= '<br/>';
  25. $sBufor .= '<a href="index.php?page=zmiana" class="xx">Zmien Nazwe Strony</a>';
  26. $sBufor .= '<br/>';
  27. $sBufor .= '<a href="index.php?page=dodajadmina" class="xx">Dodaj Admina</a>';
  28. $sBufor .= '<br/>';
  29. $sBufor .= '<a href="index.php?page=aktualizacja" class="xx">Aktualizuj strone</a>';
  30. $sBufor .= '<br/>';
  31. $sBufor .= '<a href="index.php?page=blokujstrone" class="xx">Blokuj strone</a>';
  32. $sBufor .= '<br/>';
  33. $sBufor .= '<a href="index.php?page=wyloguj" class="xx">Wyloguj?</a></div>';
  34.  
  35. }
  36.  
  37. elseif ($_SESSION['UserStatus'] == 2)
  38. {
  39. $sBufor .= 'Witaj!';
  40. $sBufor .= '<br/>';
  41. $sBufor .= 'Zostales pomyslnie zalogowany jako Moderator.';
  42. $sBufor .= '<br/>';
  43. $sBufor .= '<a href="index.php?page=dodajnewsa" class="xx">Dodaj Newsa</a>';
  44. $sBufor .= '<br/>';
  45. $sBufor .= '<a href="index.php?page=edytuj" class="xx">Edytuj Newsa</a>';
  46. $sBufor .= '<br/>';
  47. $sBufor .= '<a href="index.php?page=usun" class="xx">Usun Newsa</a>';
  48. $sBufor .= '<br/>';
  49. $sBufor .= '<a href="index.php?page=wylog" class="xx">Wyloguj?</a></div>';
  50. $sBufor .= '';
  51. $sBufor .= '';
  52. }
  53.  
  54. elseif ($user_status == 0)
  55. {
  56. $sBufor .= "<div style='position:absolute;top:-12px;left:10px;color:white;margin:auto;'>";
  57. $sBufor .= '<a href="index.php?page=zamowieniee" class="xx" style="font-size:10px;width:115px;float:left;">Twoje wiadomości(0)</a>';
  58. $sBufor .= '<a href="index.php?page=otrzymalem" class="xx" style="font-size:10px;width:70px;float:left;">Znajdź gracza</a>';
  59. $sBufor .= '<a href="index.php?page=zmianapw" class="xx" style="font-size:10px;float:left;width:170px;">Zobacz pełną liste użytkowników</a></div>';
  60. $sBufor .= "<div style='position:absolute;top:2px;left:110px;color:white;margin:auto;'>";
  61. $sbufor .= '<br/>';
  62. $sBufor .= '<a href="index.php?page=wyloguj" class="xx" style="font-size:10px;float:left;width:77px;">Edytuj profil</a>';
  63. $sBufor .= '<a href="index.php?page=wyloguj" class="xx" style="font-size:10px;float:left;width:56px;">Wyloguj się</a></div>';
  64. $sBufor .= "<div style='position:absolute;top:25px;left:15px;color:white;margin:auto;'>";
  65. $sbufor .= '<br/>';
  66. $sBufor .= '<a href="index.php?page=wyloguj" class="xx" style="font-size:10px;float:left;width:199px;color:red;">Stocz bitwe na pytania z innym graczem!</a></div>';
  67. $sBufor .= "<div style='position:absolute;top:55px;left:15px;color:white;margin:auto;font-size:10px;font-family:Verdana;'>";
  68. $sBufor .= 'Wygranych: 3333';
  69. $sBufor .= '<br/>';
  70. $sBufor .= 'PrzegranycH: 10000';
  71. $sBufor .= '<br/>';
  72. $sBufor .= 'Punkty: 15</div>';
  73. }
  74.  
  75. }
  76. elseif (!empty($_POST['wyslano']))
  77. {
  78. if (isset($_POST['username']))
  79. {
  80. $username = $_POST['username'];
  81. $username = mysql_real_escape_string($username); // sql injection ochrona
  82. }
  83.  
  84. if (isset($_POST['password']))
  85. {
  86. $password = md5($_POST['password']);
  87. $password = mysql_real_escape_string($password); // sql injection ochrona
  88. }
  89.  
  90.  
  91. $db = mysql_connect("","1","2") or die(mysql_error());
  92. $query = "SELECT status FROM `rejestracja` WHERE `nick_z_gry` = '".$username."' AND `haslo` = '".$password."'";
  93. $result = mysql_query($query) or die(mysql_error());
  94. $result = mysql_fetch_array($result);
  95. if(empty($result))
  96. {
  97. echo '<b>Logowanie nieudane. Sprawdź pisownię nicku oraz hasła.</b>';
  98. echo '<br/>';
  99. echo '<a href="index.php?page=newsy">Powrót</a>';
  100. }
  101. else
  102. {
  103. $_SESSION['zalogowany_user_login'] = $username;
  104. $_SESSION['twojehaslo_to'] = $password;
  105. $_SESSION['UserId'] = $result[0]['id'];
  106. $_SESSION['UserStatus'] = $result[0]['status'];
  107. header('Location: logowanie');
  108. }
  109.  
  110.  
  111. }
  112. else
  113. {
  114. $sBufor .= '<form action="" method="post">
  115. <div id="logowanie">
  116. <div class="lewo2">Nick z gry:</div><div class="prawo2"><input type="text" name="username" style="width:155px;"></div><br/><br/>
  117. <div class="lewo3">Hasło:</div><div class="prawo3"><input type="password" name="password" style="width:155px;"></div><br/>
  118. <div id="dol"><input type="submit" name="wyslano" value="Zaloguj" class="button3"></div>
  119. </form>
  120. <div style="text-align: center; font-family: Arial;font-size: 11px;margin-top:70px;">
  121. Nie masz konta?<a href="rejestracja" style="font-size: 11px;position: relatiave;top:-1px;left: 5px;">Zarejestruj się</a>
  122. <br/>
  123. Zapomniałeś hasło?<a href="#" style="font-size: 11px;position: relative;top:-1px;left: 5px;">Odzyskaj hasło</a>
  124. </div>
  125. </div>';
  126.  
  127.  
  128. }
  129.  
  130. echo $sBufor;
  131. echo '<br/>';
  132. echo '<br/>';
  133.  
  134.  
  135.  
  136. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 15.10.2025 - 21:08