Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MySQL] Logowanie i sesje, Dziwny problem :/
Traper21
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 2.07.2007

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


Witam wszystkich (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Mam taki o to skrypt logowania:
  1. <?php
  2. ?>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  4. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  6. <head>
  7. <title>tytul</title>
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9. <meta name="Description" content="asd" />
  10. <meta name="Keywords" content="asd" />
  11. <meta name="author" content="autor" />
  12. <link rel="stylesheet" href="../style.css" type="text/css" media="screen" />
  13. </head>
  14. <body>
  15. <div id="wrapper">
  16. <div id="top">
  17. <h1><a class="nazwa" href="#">klan</a> <span>:: admin</span></h1>
  18. <a class="kanal" href="#">chan</a>
  19. </div>
  20. <hr class="linia"></hr>
  21. <div id="bar"><span class="logowanie"><a href="#">admin</a></span><em>Ehhh:</em> 5 days</div>
  22. <hr class="linia"></hr>
  23. <div id="formlogin">
  24. <?php session_start();
  25.  
  26. $login=$_POST['login'];
  27. if(isset($login)) {
  28.  
  29. $admin=$_POST['username'];
  30. $haslo=md5($_POST['password']);
  31.  
  32. include('../db.php');
  33. $zapytanie = mysql_query("SELECT * FROM admin WHERE uzytkownik='$admin' AND haslo='$haslo'");
  34. if(mysql_num_rows($zapytanie) > 0) {
  35. $_SESSION['logged'] = $admin;
  36. header("Location: secret.php");
  37.  
  38. } else {
  39. echo "Podales zle dane";
  40. }
  41. }
  42. ?>
  43. <br /><h3>Logowanie</h3><br />
  44. <form method="post" action="login.php">
  45. <fieldset>
  46. <input type="text" name="username" class="pole" value="login" /><br />
  47. <input type="password" name="password" class="pole" value="haslo" /><br />
  48. <input type="submit" name="login" class="wysylaj" value="zaloguj się" />
  49. </fieldset>
  50. </form>
  51. </div>
  52. <hr class="linia"></hr>
  53. Š Strona
  54. </div>
  55. </body>
  56. </html>
  57. <?php ob_end_flush(); ?>


Lecz przy wejsciu na strone dostaję komunikat:
  1. <?php
  2. Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:VertrigoServwwwlistadminlogin.php:1) in C:VertrigoServwwwlistadminlogin.php on line 25
  3.  
  4. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:VertrigoServwwwlistadminlogin.php:1) in C:VertrigoServwwwlistadminlogin.php on line 25
  5. ?>


Co jest nie tak?

Ten post edytował Traper21 30.07.2007, 00:33:31
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.09.2025 - 15:22