Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]nie mogę sie zalogować
Johnas
post
Post #1





Grupa: Zarejestrowani
Postów: 650
Pomógł: 16
Dołączył: 5.07.2010
Skąd: Ściśle Tajne

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


Witam mam problem z zalogowaniem sie nie wiem czemu... na stronie cs-master.xaa.pl wszystko działa a na nowej pod linkiem youphoto po prubie zalogowania sie wyskakuje okno i nic sie nie robi jak by $_post nie działał... kod mam taki
  1. if (isset($_SESSION['login'])) { // dostęp dla niezalogowanego użytkownika
  2.  
  3.  
  4. header("Location: profile.php");
  5. } else {
  6. ?>
  7. <h2>Panel logowania</h2>
  8. <div class="box">
  9. <div class="inner">
  10. <div class="wrapper">
  11. <?php
  12. if ($_POST['logowanie']) { // jeżeli formularz został wysłany, to wykonuje się poniższy skrypt
  13.  
  14.  
  15. $tabela = 'rejestracja'; // zdefiniowanie tabeli MySQL
  16.  
  17. $login = mb_strtolower($_POST["login"]);
  18. $haslo = $_POST["pass"];
  19.  
  20. $haslo = md5($haslo); // szyfrowanie podanego hasła
  21.  
  22. $wynik=mysql_query("SELECT * FROM $tabela WHERE
  23. login='$login' and haslo='$haslo' and status=0");
  24.  
  25.  
  26. // jeżeli użytkownik zarejestrował się, a nie aktywował swojego konta, to wyświetla się komunikat
  27. if (mysql_num_rows($wynik) == 1) {
  28. $informacja = mysql_fetch_array($wynik);
  29. echo '<span class="blad">Nie aktywowałeś jeszcze swojego konta. Aby to zrobić, wejdź w swoją skrzynkę odbiorczą, a następnie znajdź wiadmość z linkiem aktywacyjnym i aktywuj swoje konto</span>';
  30. }
  31.  
  32. // jeżeli wszystko jest dobrze, użytkownik się loguje
  33. $wynik=mysql_query("UPDATE $tabela SET online=1 WHERE
  34. login='$login' and haslo='$haslo' and status=1");
  35. $wynik=mysql_query("SELECT * FROM $tabela WHERE
  36. login='$login' and haslo='$haslo' and status=1");
  37.  
  38. if (mysql_num_rows($wynik) == 1) {
  39. $informacja = mysql_fetch_array($wynik);
  40. $_SESSION["login"] = $informacja["login"];
  41. $_SESSION["email"] = $informacja["email"];
  42. $_SESSION["imie"] = $informacja["imie"];
  43. $_SESSION["nazwisko"] = $informacja["nazwisko"];
  44. $_SESSION["id"] = $informacja["id"];
  45. $_SESSION["id_rangi"] = $informacja["id_rangi"];
  46.  
  47. header('Location: profile.php?act=o_mnie ');
  48. } else {
  49. echo '<span class="blad">Nie poprawny login lub hasło!</span> ';
  50. }
  51.  
  52. }
  53.  
  54. ?>
  55. <!-- PANEL LOGOWANIA -->
  56.  
  57. <form action="index.php" method="post">
  58. <input type="hidden" name="logowanie" value="TRUE" />
  59. <div id="logowanie">
  60. <p>Login: <input type="text" name="login" id="acpro_inp0"></p>
  61. <p>Hasło: <input type="password" name="pass" id="acpro_inp0"></p>
  62. </div>
  63.  
  64. <p><input type="checkbox" name="nazwa" value="wartość" id="acpro_inp0" /> Zapamiętaj
  65.  
  66. <center><input align="center" class="submit" type="submit" value="Zaloguj" /></center>
  67.  
  68. </form>
  69. <hr />
  70. <a href="memory.php">Zapomniałeś hasła? Kliknij tutaj!</a>
  71. <!-- KONIEC PANELU -->
  72. <div class="clear"></div>
  73. </div>
  74. </div>
  75. </div>


To jest tylko fragment odpowiedzialny za logowanie... nie wiem co może być nie tak


Dodam że przenoszę strone na VPS
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Johnas
post
Post #2





Grupa: Zarejestrowani
Postów: 650
Pomógł: 16
Dołączył: 5.07.2010
Skąd: Ściśle Tajne

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


odebrałem je... pewnie nie wpisałem nic w pole login i hasło

napisałeś
Kod
może wtedy wpadniesz na to czego brakuje
ale się nie domyśliłem

i co jeszcze jest dziwne opcja register globals na serwerze jest aktywna niby

  1. if ($_POST['logowanie']) { // jeżeli formularz został wysłany, to wykonuje się poniższy skrypt
  2.  
  3.  
  4. $tabela = 'rejestracja'; // zdefiniowanie tabeli MySQL
  5.  
  6. $_POST['login'] = mb_strtolower($_POST["login"]);
  7. $_POST['pass'] = $_POST["pass"];
  8.  
  9. $_POST['pass'] = md5($_POST['pass']); // szyfrowanie podanego hasła
  10.  
  11. $wynik=mysql_query("SELECT * FROM $tabela WHERE
  12. login={$_POST['login']} and haslo={$_POST['pass']} and status=0");
  13.  
  14.  
  15. // jeżeli użytkownik zarejestrował się, a nie aktywował swojego konta, to wyświetla się komunikat
  16. if (mysql_num_rows($wynik) == 1) {
  17. $informacja = mysql_fetch_array($wynik);
  18. echo '<span class="blad">Nie aktywowałeś jeszcze swojego konta. Aby to zrobić, wejdź w swoją skrzynkę odbiorczą, a następnie znajdź wiadmość z linkiem aktywacyjnym i aktywuj swoje konto</span>';
  19. }
  20.  
  21. // jeżeli wszystko jest dobrze, użytkownik się loguje
  22. $wynik=mysql_query("UPDATE $tabela SET online=1 WHERE
  23. login={$_POST['login']} and haslo={$_POST['pass']} and status=1");
  24. $wynik=mysql_query("SELECT * FROM $tabela WHERE
  25. login={$_POST['login']} and haslo={$_POST['pass']} and status=1");
  26.  
  27. if (mysql_num_rows($wynik) == 1) {
  28. $informacja = mysql_fetch_array($wynik);
  29. $_SESSION["login"] = $informacja["login"];
  30. $_SESSION["email"] = $informacja["email"];
  31. $_SESSION["imie"] = $informacja["imie"];
  32. $_SESSION["nazwisko"] = $informacja["nazwisko"];
  33. $_SESSION["id"] = $informacja["id"];
  34. $_SESSION["id_rangi"] = $informacja["id_rangi"];
  35.  
  36. header('Location: profile.php?act=o_mnie ');
  37. } else {
  38. echo '<span class="blad">Nie poprawny login lub hasło!</span> ';
  39. }
  40.  
  41. }
  42.  
  43. ?>
  44. <!-- PANEL LOGOWANIA -->
  45.  
  46. <form action="" method="post">
  47. <input type="hidden" name="logowanie" value="TRUE" />
  48. <div id="logowanie">
  49. <p>Login: <input type="text" name="login" id="acpro_inp0"></p>
  50. <p>Hasło: <input type="password" name="pass" id="acpro_inp0"></p>
  51. </div>
  52.  
  53. <p><input type="checkbox" name="nazwa" value="wartość" id="acpro_inp0" /> Zapamiętaj
  54.  
  55. <center><input align="center" class="submit" type="submit" value="Zaloguj" /></center>
  56.  
  57. </form>
  58. <hr />
  59. <a href="memory.php">Zapomniałeś hasła? Kliknij tutaj!</a>
  60. <!-- KONIEC PANELU -->
  61. <div class="clear"></div>
  62. </div>
  63. </div>
  64. </div>


Zrobiłem tak dalej nic (IMG:style_emoticons/default/sad.gif)

Logi serwera:

Kod
[Mon Feb 21 03:44:50 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/demos.css, referer: http://youphoto.pl/
[Mon Feb 21 03:44:50 2011] [error] [client 93.94.189.1] PHP Fatal error:  Call to undefined function mb_strtolower() in /home/youphoto/public_html/index.php on line 38, referer: http://youphoto.pl/
[Mon Feb 21 03:44:50 2011] [error] [client 93.94.189.1] PHP Notice:  Undefined index:  login in /home/youphoto/public_html/header.php on line 27, referer: http://youphoto.pl/
[Mon Feb 21 03:44:48 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml
[Mon Feb 21 03:44:48 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/favicon.ico
[Mon Feb 21 03:44:47 2011] [error] [client 93.94.189.1] PHP Notice:  Undefined index:  wylogowanie in /home/youphoto/public_html/index.php on line 231
[Mon Feb 21 03:44:47 2011] [error] [client 93.94.189.1] PHP Notice:  Undefined index:  logowanie in /home/youphoto/public_html/index.php on line 33
[Mon Feb 21 03:44:47 2011] [error] [client 93.94.189.1] PHP Notice:  Undefined index:  login in /home/youphoto/public_html/header.php on line 27
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/favicon.ico
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml, referer: http://youphoto.pl/
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/images/logo.gif, referer: http://youphoto.pl/
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml, referer: http://youphoto.pl/
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/images/logo-bg.png, referer: http://youphoto.pl/
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml, referer: http://youphoto.pl/
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/images/main-tail-bot.gif, referer: http://youphoto.pl/
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml, referer: http://youphoto.pl/
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/demos.css, referer: http://youphoto.pl/
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] PHP Fatal error:  Call to undefined function mb_strtolower() in /home/youphoto/public_html/index.php on line 38, referer: http://youphoto.pl/
[Mon Feb 21 03:44:45 2011] [error] [client 93.94.189.1] PHP Notice:  Undefined index:  login in /home/youphoto/public_html/header.php on line 27, referer: http://youphoto.pl/
[Mon Feb 21 03:44:43 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml
[Mon Feb 21 03:44:43 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/favicon.ico
[Mon Feb 21 03:44:43 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml, referer: http://youphoto.pl/
[Mon Feb 21 03:44:43 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/images/footer.gif, referer: http://youphoto.pl/
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml, referer: http://youphoto.pl/
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/images/logo.gif, referer: http://youphoto.pl/
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml, referer: http://youphoto.pl/
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/images/logo-bg.png, referer: http://youphoto.pl/
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml, referer: http://youphoto.pl/
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/images/main-tail-bot.gif, referer: http://youphoto.pl/
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/404.shtml, referer: http://youphoto.pl/
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] File does not exist: /home/youphoto/public_html/demos.css, referer: http://youphoto.pl/
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] PHP Notice:  Undefined index:  wylogowanie in /home/youphoto/public_html/index.php on line 231
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] PHP Notice:  Undefined index:  logowanie in /home/youphoto/public_html/index.php on line 33
[Mon Feb 21 03:44:42 2011] [error] [client 93.94.189.1] PHP Notice:  Undefined index:  login in /home/youphoto/public_html/header.php on line 27


Jak by tego było mało to nie działa mi praktycznie nic... tzn index naprawiłem była to niby wina tego mb_strtolower() bo jak usunołem to gra ale teraz nie działa mi klasa, zmiana aavataru i połowa funkcji czemu i jak to naprawić? PILNE
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: 14.10.2025 - 13:40