Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Problem z session_start (headers already sent)
Vion
post 14.02.2011, 18:09:21
Post #1





Grupa: Zarejestrowani
Postów: 112
Pomógł: 2
Dołączył: 27.06.2008

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


Witam
Mam o to taki błąd
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /homepages/16/d339296823/htdocs/epicshot/addshot.php:1) in /homepages/16/d339296823/htdocs/epicshot/auth_user.php on line 3

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /homepages/16/d339296823/htdocs/epicshot/addshot.php:1) in /homepages/16/d339296823/htdocs/epicshot/auth_user.php on line 3
Nie moge przekierowac. Wyslano juz naglowki.
Probowałem już rożnych metod ale dalej nie działa, dałem tez ob_start() bo myślałem ze pomoże, ale nic z tego. Co jest nie tak?

o to kod auth_user.php
  1. <?php
  2.  
  3.  
  4. require_once "header.php";
  5.  
  6.  
  7. if
  8. ((isset($_SESSION['user_logged']) &&
  9. $_SESSION['user_logged'] != "") ||
  10.  
  11. (isset($_SESSION['user_id']) &&
  12. $_SESSION['user_id'] != "") ||
  13.  
  14. (isset($_SESSION['user_password']) &&
  15. $_SESSION['user_password'] != "")) {
  16.  
  17. } else {
  18. redirect('index.php');
  19. }


kod addshot.php
  1. <?php
  2. require_once "auth_user.php";
  3. require_once "function_engine.php";
  4. require_once "function_graph.php";
  5. header_blok();
  6.  
  7.  
  8. filled();?>
  9.  
  10. <table border="0" width="631" cellspacing="1" cellpadding="3" bgcolor="#353535" >
  11. <tr>
  12. <td border="0" bgcolor="#FF6633" width="100%" height="50" align="center">
  13. W tym miejscu możesz wrzucić swojego shot'a. <br>Przyjmowane są obrazy w formatach: GIF, JPG/JPEG i PNG.<br>
  14. Maksymalny rozmiar pliku to 1MB,
  15. szerokosc :800 pikseli,
  16. wysokosc: 600 pikseli
  17. </b></center>
  18. </td>
  19. </tr>
  20. </table><br>
  21.  
  22. <form name="image_add" method="post" action="transact_shot.php?action=add" enctype="multipart/form-data">
  23.  
  24. <table border="0" width="631" cellspacing="1" cellpadding="3" bgcolor="#259CF7" ><tr>
  25. <td border="0" bgcolor="" width="100%" align="LEFT">&nbsp;&nbsp;UMIESZCZANY OBRAZ</td></tr></table><br>
  26. <input name="image_filename" type="file" size="29"> <br><br>
  27. <table border="0" width="631" cellspacing="1" cellpadding="3" bgcolor="#259CF7" ><tr>
  28.  
  29.  
  30. </select>
  31.  
  32.  
  33. <input type="submit" name="Submit" value="Wyślij">
  34.  
  35. </form><BR><BR>
  36.  
  37. <?php


header.php
  1. <?php
  2.  
  3. function redirect($url) {
  4. if (!headers_sent()) {
  5. header('Location: http://' . $_SERVER['HTTP_HOST'] .
  6. dirname($_SERVER['PHP_SELF']) . '/' . $url);
  7. } else {
  8. die('Nie moge przekierowac. Wyslano juz naglowki.');
  9. }
  10. }
  11.  


--------------------
www.zapalara.pl
Go to the top of the page
+Quote Post

Posty w temacie


Closed 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:05