Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Pusta strona i session_start(), ???
-Wieviór-
post 12.03.2005, 13:45:45
Post #1





Goście







index.php:
  1. include 'config.php';
  2. if (!$_POST['login'])
  3. {
  4. echo'<form method=\"POST\" action=\"index.php\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
  5. <tr><td><b>Zaloguj się do administracji lfc.pl</b></td></tr>
  6. <tr><td>
  7. Login: <input type=\"text\" name=\"login\" size=\"20\"><br>
  8. Hasło: <input type=\"text\" name=\"pass\" size=\"20\"><br>
  9. <input type=\"submit\" value=\"Zaloguj\" name=\"Submit\"></td>
  10. </tr>
  11. <tr><td><p align=\"center\"><b>Football Admin v.'.$wersja.'</b> by <b><a href=\"mailto:wievior@tlen.pl\">Wieviór</a></b> for <b>www.lfc.pl</b></td></tr>
  12. </table></form>';
  13. } else {
  14. $sql = &#092;"SELECT * FROM uzytkownicy WHERE login = '\".$_POST['login'].\"'\";
  15. $wykonaj = mysql_query($sql);
  16. $login = mysql_fetch_array($wykonaj);
  17. if (!$_POST['pass'] == $login['haslo'])
  18. { echo 'Podano błędne dane.<br><a href=\"index.php\">Jeszcze raz</a>';
  19. } else {
  20. $_SESSION['login'] = $login['login'];
  21. echo 'Zostałeś zalogowany '.$_SESSION['login'].' <a href=\"admin.php\">Przejdź dalej</a>.';
  22. }
  23. }
  24. ?>


admin.php:
  1. include 'config.php';
  2. function getDirAndFileName($URL)
  3. {
  4. $parts = parse_url($URL);
  5. $path = explode('/', $parts['path']);
  6. $path = array_slice ($path, -2, 2);
  7. return implode('/', $path);
  8. }
  9. ?>
  10. <head>
  11. <title>Administracja lfc.pl</title>
  12. <script type=\"text/javascript\">
  13. function windowOpen()
  14. {
  15. window.open('obrazki.php', 'whdWindow', 'toolbar=yes, status=yes, scrollbars=yes, location=yes, menubar=yes, directories=
  16. es, width=500, height=400')
  17. }
  18. </script>
  19. <meta http-equiv=\"Content-type\" content=\"text/html; charset=iso-8859-2\">
  20. <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"></head>
  21. <body background=\"img/tlo.gif\">
  22. <?
  23. if (!$_SESSION['login'])
  24. {
  25. echo 'Nie masz uprawnień by oglądać tą stronę.';
  26. } else { cośtam dalej


No i teraz po zalogowaniu się i przejściu dalej pokazuje mi się biała strona, refresh i już jest normalnie treść admin.php. Ale dlaczego na początku pokazuje mi się biała? sad.gif worriedsmiley.gif
Go to the top of the page
+Quote Post
SongoQ
post 12.03.2005, 13:54:13
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


  1. <?
  2. if (!$_SESSION['login'])
  3. {
  4. echo 'Nie masz uprawnień by oglądać tą stronę.';
  5. } else { cośtam dalej
  6.  
  7. ?>


Wstaw echo 'xxx' i zobacz gdzie sie zatrzymuje gzdie wchodzi itd. Moze to nie jest w tym miejscu.


--------------------
Go to the top of the page
+Quote Post
-Wieviór-
post 12.03.2005, 14:12:39
Post #3





Goście







  1. <?
  2. echo 'lol';
  3. if (!$_SESSION['login'])
  4. {
  5.  
  6. ?>


Już się nie pokazało, wcześniej jak dawałem zaraz po session_start(); to pokazywało. czyli tak jakby head coś psuł worriedsmiley.gif
Go to the top of the page
+Quote Post
SongoQ
post 12.03.2005, 14:25:24
Post #4





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


  1. include 'config.php';
  2. function getDirAndFileName($URL)
  3. {
  4. $parts = parse_url($URL);
  5. $path = explode('/', $parts['path']);
  6. $path = array_slice ($path, -2, 2);
  7. return implode('/', $path);
  8. }
  9. ?>


A przed config.php i po - wyswietla sie cos z echo?


--------------------
Go to the top of the page
+Quote Post
-Wieviór-
post 12.03.2005, 14:27:29
Post #5





Goście







  1. echo 'lol';
  2. include 'config.php';
  3. function getDirAndFileName($URL)
  4. {
  5. $parts = parse_url($URL);
  6. $path = explode('/', $parts['path']);
  7. $path = array_slice ($path, -2, 2);
  8. return implode('/', $path);
  9. }
  10. ?>


  1. include 'config.php';
  2. function getDirAndFileName($URL)
  3. {
  4. $parts = parse_url($URL);
  5. $path = explode('/', $parts['path']);
  6. $path = array_slice ($path, -2, 2);
  7. return implode('/', $path);
  8. }
  9. echo 'lol';
  10. ?>


oba działają
Go to the top of the page
+Quote Post
SongoQ
post 12.03.2005, 15:23:19
Post #6





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


Dzialaja nawet kiedy sie wyswietla biala strona?


--------------------
Go to the top of the page
+Quote Post
-Wieviór-
post 12.03.2005, 16:02:18
Post #7





Goście







Wyswietla się biała strona z
"lol"

Mam:
  1. <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">

Usunąłem tą linijke i nagle działa, ale co to za idiotyzm... sad.gif

Ten post edytował Wieviór 12.03.2005, 16:04:38
Go to the top of the page
+Quote Post
vala
post 12.03.2005, 22:31:10
Post #8





Grupa: Zarejestrowani
Postów: 123
Pomógł: 0
Dołączył: 12.01.2005

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


kodowanie polskich krzakow:)


--------------------
Warsztat: Easy PHP 1.7:Apache 1.3.27|PHP 4.3.3|PHPMYADMIn 2.5.3|MYSQL 4.0.15
Go to the top of the page
+Quote Post
czachor
post 12.03.2005, 22:46:08
Post #9





Grupa: Zarejestrowani
Postów: 897
Pomógł: 40
Dołączył: 16.12.2003
Skąd: Warszawa

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


A spróbuj wstawić przed session_start() coś takiego:
  1. <?php
  2. session_cache_limiter(&#092;"private\"); //lub \"private_no_expire\", gdyby wystąpiły problemy np. pod Mozillą
  3. ?>


--------------------
how many SEO experts does it take to change a light bulb,lightbulb,light,bulb,lamp,lighting,switch,sex,xxx
5-Reasons-why-you-should-NEVER-fix-a-computer-for-free
Go to the top of the page
+Quote Post
-Wieviór-
post 13.03.2005, 08:56:00
Post #10





Goście







W sumie to już mi tam wszystko działa, nie wiem czemu. tongue.gif

Dzieki za pomoc anyway winksmiley.jpg
Go to the top of the page
+Quote Post
sobstel
post 14.03.2005, 09:56:17
Post #11





Grupa: Zarejestrowani
Postów: 853
Pomógł: 25
Dołączył: 27.08.2003
Skąd: Katowice

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


problem juz byl poruszany przynajmniej 2 razy. problem z session_cache_limiter('private') jest taki ze ustawiamy cacheowanie przez przgladarka, a w przypadku generowanych dynamicznie stron php moze to byc duzy klopot. radzilbym przy okazji wysylanie naglowka Modified.


--------------------
"If debugging is the process of removing bugs, then programming must be the process of putting them in..."
sobstel.org
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 02:27