Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> header php
Mlodycompany
post
Post #1





Grupa: Zarejestrowani
Postów: 910
Pomógł: 44
Dołączył: 20.02.2008
Skąd: Łódź

Ostrzeżenie: (20%)
X----


Witam. Wiem, ze ten temat byl poruszany nie raz na forum, ale z przyczyn nie zalezych odemnie domena nie dziala co za tym idzie wyszukiwarka tez nie zbyt funkcjonuje, wiec jestem zmuszony napisac nowy temat.
Wiec:
  1. <?php
  2. header("Location: index.php");
  3. ?>

i wyskakuje taki blad: Warning: Cannot modify header information - headers already sent by.
Od czego to zalezy, bo na innych stronach mi to działa a na tej nie
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Mlodycompany
post
Post #2





Grupa: Zarejestrowani
Postów: 910
Pomógł: 44
Dołączył: 20.02.2008
Skąd: Łódź

Ostrzeżenie: (20%)
X----


index.php
  1. <?
  2. include('functions.php');
  3.  
  4. function menu1(){
  5. include('menu1.php');
  6. }
  7. function strona(){
  8. $dir = "./";
  9. if(!($fd = opendir($dir)))
  10. exit("Bład");
  11. if($_GET['name'] == $_GET['name']){
  12. $plik = $_GET['name'].'.php';
  13. while($file = readdir($fd)){
  14.  
  15. //echo $plik;
  16. //echo "<br>";
  17. if($file == $plik){
  18.  
  19. $inc = include(''.$plik.'');
  20.  
  21. }
  22.  
  23. }
  24. if(!$inc && $_GET['name'] != ""){
  25. echo('<table class="tabela2" align="center" cellspacing="0" cellpadding="0">
  26. <tr><th class=naglowek></th></tr>
  27. <tr><th>Ta Strona Nie Znajduje Się Na Serwerze</th></tr></table>');
  28. }
  29. }
  30. $get_name = basename($_GET['name']);
  31. //if($get_name != "" && $get_name == $get_name){
  32.  
  33. //include(''.$get_name.'.php');
  34.  
  35. //}
  36.  
  37. if($_GET['news'] == "" && $_GET['name'] == "" && $_GET['user'] == ""){
  38. include('news.php');
  39. }
  40. if($_GET['user'] == $_GET['user']){
  41. $user = mysql_query("SELECT * FROM `users` WHERE `login` = '".$_GET['user']."'");
  42. $suma = mysql_num_rows($user);
  43. if($suma == 1){
  44. while($row = mysql_fetch_array($user)){
  45. echo('<table class="tabela2" align="center" cellspacing="0" cellpadding="0">
  46. <tr>
  47. <th>'.$row[1].'</th>
  48. </tr>
  49. </table>');
  50. }
  51. }}
  52. if($_GET['news'] == $_GET['news']){
  53. $news1 = mysql_query("SELECT * FROM `newsy` WHERE `dodal` = '".$_GET['news']."'");
  54. while($new1 = mysql_fetch_array($news1)){
  55.  
  56. echo('<table class="tabela2" align="center" cellspacing="0" cellpadding="0"><tr><th><a href="index.php?news='.$_GET['news'].'&id='.$new1[0].'">'.$new1[3].'</a></th><th>'.$new1[2].'</th></tr></table>');
  57. }
  58.  
  59. }
  60. }
  61. function menu2(){
  62. include('menu2.php');
  63. }
  64. ?>
  65. <html>
  66. <head>
  67. <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  68. <link rel="stylesheet" href="style.css" type="text/css">
  69. <script type="text/javascript" src="menu.js"></script>
  70. <link rel="Shortcut icon" href="pictures/favicon.ico">
  71. </head>
  72. <table class="tabela" align="center" cellspacing="1" cellpadding="0">
  73. <tr>
  74. <td colspan="3" class="logo" valign="bottom" align="right">
  75.  
  76. </td>
  77. </tr>
  78. <tr>
  79. <th class="menu" valign="top"><?php menu1();?></th>
  80. <th class="page" valign="top"><?php strona();?></th>
  81. <th class="menu" valign="top"><?php menu2();?></th>
  82. </tr>
  83.  
  84. </table>
  85. </html></form>


plik.php
  1. <?php
  2. header("Location: index.php");
  3. ?>
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: 4.10.2025 - 17:55