Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> headers already sent - pierwszy problem ze skryptem, drugi - czemu nie chce wyciagnac pliku z bazy ;/
andy84
post
Post #1





Grupa: Zarejestrowani
Postów: 165
Pomógł: 0
Dołączył: 14.11.2005
Skąd: London

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


Zrobilem formularz z uploadem cv jednak po odpaleniu informacji wyswietlanych dostaje takie komunikaty bledu:

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\prolinc\project\admin\header.php:7) in C:\AppServ\www\prolinc\project\admin\regusers\fulldetails.php on line 13

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\prolinc\project\admin\header.php:7) in C:\AppServ\www\prolinc\project\admin\regusers\fulldetails.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\prolinc\project\admin\header.php:7) in C:\AppServ\www\prolinc\project\admin\regusers\fulldetails.php on line 15

a tutaj jest kod
  1. <?php
  2. include ("../header.php");
  3. include ("../config.inc.php");
  4.  
  5. mysql_connect($host,$user,$password);
  6. @mysql_select_db($database) or die ("Unable to select database");
  7.  
  8. if(isset($_GET['id']))
  9. $id = $_GET['id']; 
  10. $query="SELECT * FROM registry WHERE id='$id'";
  11. $result = mysql_query($query) or die('Error, query failed'); 
  12. list($name, $type, $size, $content) = mysql_fetch_array($result); 
  13. header("Content-Disposition: attachment; filename=$name"); 
  14. header("Content-length: $size"); 
  15. header("Content-type: $type"); 
  16. $num=mysql_num_rows($result);
  17. $i=0;
  18. while($i < $num){
  19.  
  20. $id=mysql_result($result,$i,"id");
  21. $firstname=mysql_result($result,$i,"firstname");
  22. $surname=mysql_result($result,$i,"surname");
  23. $address1=mysql_result($result,$i,"address1");
  24. $address2=mysql_result($result,$i,"address2");
  25. $postcode=mysql_result($result,$i,"postcode");
  26. $towncity=mysql_result($result,$i,"towncity");
  27. $email=mysql_result($result,$i,"email");
  28. $mobile=mysql_result($result,$i,"mobile");
  29. $string=mysql_result($result,$i,"string");
  30. $experience=mysql_result($result,$i,"experience");
  31. $addinfo=mysql_result($result,$i,"addinfo");
  32. $day=mysql_result($result,$i,"day");
  33. $mth=mysql_result($result,$i,"mth");
  34. $year=mysql_result($result,$i,"year");
  35. ?>


reszta kodu tego samego pliku
  1. <? 
  2. #include 'library/config.php'; 
  3. #include 'library/opendb.php'; 
  4.  
  5. $query = "SELECT id, name FROM registry"; 
  6. $result = mysql_query($query) or die('Error, query failed'); 
  7. if(mysql_num_rows($result) == 0) 
  8. { 
  9. echo "Database is empty <br>"; 
  10. }
  11. else 
  12. { 
  13. while(list($id, $name) = mysql_fetch_array($result)) 
  14. { 
  15. ?> 
  16. <a href="fulldetails.php?id=<?=$id;?>"><?=$name;?></a> <br> 
  17. <?  
  18. } 
  19. } 
  20. #include 'library/closedb.php'; 
  21. ?> 
  22. </td>
  23. </tr>
  24. </table>
  25. <p><hr></p></td>
  26. <td> </td> 
  27. </tr>
  28. <tr>
  29. <td> </td>
  30. <td> </td>
  31. <td> </td>
  32. </tr>
  33. </table></td>
  34. </tr>
  35. </table>
  36. <?php
  37. $i++;
  38.  exit; 
  39. }
  40. include('../../footer.php');
  41. ?>


Moze ktos z wiekszym doswiadczeniem powie mi gdzie tu jest blad ;/ bo ja go nie moge zrozumiec


--------------------
Linux is like Wigwam - no Windows, no Gates and apache inside :D
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 21.08.2025 - 08:26