Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Header location problem
bigart
post 3.11.2009, 18:45:30
Post #1





Grupa: Zarejestrowani
Postów: 68
Pomógł: 0
Dołączył: 20.10.2006

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


Witam,
mam problem z przekierowanie przez header("Location : ");
napisałem sobie prosty kod:
  1. <?php
  2. if (isset($_POST['logowanie']))
  3. {
  4. if (($_POST["login"]=='user')&&($_POST["haslo"]=='user1'))
  5. {
  6. $_SESSION["user"]=$_POST["login"];
  7. //echo $_SESSION["user"];
  8. header("Location : index.php");
  9. //exit;
  10. }
  11. else
  12. {
  13. header("Location : blad.php");
  14. exit;
  15. }
  16. }
  17.  
  18. if (!$_SESSION["user"])
  19. {
  20.  
  21.  
  22. echo "<form action='login.php' method='POST'>";
  23. echo "<input type='text' name='login'>";
  24. echo "<input type='password' name='haslo'>";
  25. echo "<input type='submit' name='logowanie' value='Zaloguj'>";
  26. echo "</form>";
  27. }
  28. else
  29. {
  30. header("Location : index.php");
  31. //exit;
  32. }
  33. ?>

i niestety przy poprawnym logowaniu nie przekierowuje?
możecie jakoś pomóc? może coś w ustawieniach php mam źle ?
Go to the top of the page
+Quote Post

Posty w temacie
- bigart   [php] Header location problem   3.11.2009, 18:45:30
- - Nattfarinn   Usuń spację pomiędzy dwukropkiem a wyrazem Locatio...   3.11.2009, 19:10:13
- - bigart   działa Dzięki!   3.11.2009, 19:19:32


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 - 04:54