php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 07.08.2004, 12:59  
Gast
 
Beiträge: n/a
Standard Warning: Cannot modify header... einbinden nicht möglich?

Hallo zusammen!

ich möchte über include einen Webcalender in meine site einbinden.
leider bekomme ich dann die Meldung:

Warning: Cannot modify header information - headers already sent by (output started at (...)/intern/main.php:15) in (...)intern/includes/functions.php on line 312
Redirecting to... here

Diese Fehlermeldung resultiert daraus, wenn vor header() etwas an den client gesendet wurde, soweit ich das verstanden habe.
Aber wie kann ich das verhindern, wenn der Webcalender eben nur ein Teil mein site ist... dass, da vorher schon Daten gesendet werden, läßt sich wohl nicht verhinden, oder?

main.php(gekürzt):

PHP-Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
html>
<
head>
<
title>Test</title>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<
link href="style.css" rel="stylesheet" type="text/css">
</
head>

<
body bgcolor="#EEEEEE">
<
table width="100%" cellspacing="0" cellpadding="0" height="100%">
<
tr><td align="center">

<
table width="95%" height="95%" >
<
tr
<
td class="bgcolor"></td//LINE 15
... 
functions.php(auszug):
PHP-Code:
// send a redirect to the specified page
// MS IIS/PWS has a bug in which it does not allow us to send a cookie
// and a redirect in the same HTTP header.
// See the following for more info on the IIS bug:
//   [url]http://www.faqts.com/knowledge_base/view.phtml/aid/9316/fid/4[/url]
function do_redirect $url ) {
  global 
$SERVER_SOFTWARE$_SERVER$c;
  if ( empty ( 
$SERVER_SOFTWARE ) )
    
$SERVER_SOFTWARE $_SERVER["SERVER_SOFTWARE"];
  
//echo "SERVER_SOFTWARE = $SERVER_SOFTWARE 
"; exit;
  if ( substr ( $SERVER_SOFTWARE, 0, 5 ) == "
Micro" ) {
    echo "
<HTML><HEAD><TITLE>Redirect</TITLE>" .
      "
<META HTTP-EQUIV="Refresh\" CONTENT=\"0; URL=$url\"></HEAD><BODY>" .
      
"Redirecting to ... <A HREF=\"" $url "\">here</A>.</BODY></HTML>.\n";
  } else {


 
//LINE 312                          Header ( "Location: $url" );                                                
    
echo "<HTML><HEAD><TITLE>Redirect</TITLE></HEAD><BODY>" .
      
"Redirecting to ... <A HREF=\"" $url "\">here</A>.</BODY></HTML>.\n";
  }
  
dbi_close $c );
  exit;
}


// send an HTTP login request
function send_http_login () {
  global 
$lang_file$application_name;

  if ( 
strlen $lang_file ) ) {
    
Header "WWW-Authenticate: Basic realm=\"" translate("Title") . "\"");
    
Header "HTTP/1.0 401 Unauthorized" );
    echo 
"<HTML><HEAD><TITLE>Unauthorized</TITLE></HEAD><BODY>\n" .
      
"<H2>" translate("Title") . "</H2>" .
      
translate("You are not authorized") .
      
"\n</BODY></HTML>\n";
  } else {
    
Header "WWW-Authenticate: Basic realm=\"WebCalendar\"");
    
Header "HTTP/1.0 401 Unauthorized" );
    echo 
"<HTML><HEAD><TITLE>Unauthorized</TITLE></HEAD><BODY>\n" .
      
"<H2>WebCalendar</H2>" .
      
"You are not authorized" .
      
"\n</BODY></HTML>\n";
  }
  exit;

 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 07.08.2004, 13:57  
Gast
 
Beiträge: n/a
Standard

Wie oft muss man das noch durchkauen--- HEADER kommen ganz nach oben im DOkument, deswegen heissen sie auch so (header, head=Kopf=oben).
Suche nach "headers already sent":
Die Suche hat 60 Ergebnisse ergeben.
 
Alt 07.08.2004, 15:06  
Gast
 
Beiträge: n/a
Standard

entschuldigung, dass ich etwas auf der leitung stehe.
wenn du kurz zeit hast, könntest du bitte anhand des scriptes veranschaunlichen was du meinst?

rufe ich den kalender direkt, also nicht innerhalb meiner site auf, funktioniert alles, daraus schließe ich, dass ich in der function.php nichts ändern muß, sondern nur in der main.php. laut deinem beitrag müßte ich den header() nach oben verschieben, allerdings kommt diese function nicht in der main.php vor.
scheinbar habe ich ein verständnisproblem, das auch die links über die suche nicht lösen können

Was müßte ich in der main.php verändern?
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[Erledigt] PHP -&gt; Ordner anlegen der sich auch beschreiben lässt?! Nightuser PHP Tipps 2008 13 30.06.2008 23:51
Cannot modify header information PHP-Fortgeschrittene 13 24.10.2006 20:01
Cannot modify header information...??? imported_FlasH PHP Tipps 2007 33 12.11.2005 11:58
Warning: Cannot modify header information - headers already LP PHP Tipps 2005-2 2 12.09.2005 19:28
Fehler: Warning: Cannot modify header information - headers PHP Tipps 2005-2 14 01.09.2005 15:02
Suche Tipps für Persormance-Steigerung (Geld für Nützliches) Beitragsarchiv 18 16.08.2005 10:57
Problem: Cannot modify header information Alpha Centauri PHP Tipps 2005 11 25.04.2005 13:05
update auf php 5.0.4 robo47 Server, Hosting und Workstations 6 10.04.2005 19:00
cannot modify header information!?!?! Fraylman PHP Tipps 2005 14 18.03.2005 18:14
Cannot modify header information - headers already sent PHP Tipps 2005 2 15.03.2005 22:10
Warning: Cannot modify header information ... PHP Tipps 2005 24 15.02.2005 11:07
admincontrolpanel: Cannot modify header information ? phpfortgeschrittener PHP Tipps 2004 2 23.08.2004 19:17
Cannot modify header information - headers already sent by PHP Tipps 2004 2 25.07.2004 19:40
Warning: Cannot modify header information PHP Tipps 2004 8 22.07.2004 00:50
Warning: Cannot modify header information.... PHP Tipps 2004 4 18.06.2004 01:38

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
php header einbinden, header einbinden php, php header einbindung, warning: cannot modify header information - headers already sent by header(\'http/1.0 401 unauthorized\');, header in php einbinden, php header datei einbinden, php datei in head einbinden, php header webcal, php refresh einbinden, webcalendar redirecting to.. here, php modify header title, header.php einbinden, php einbinden header, php in header einbinden, header per php einbinden, php in head einbinden, cannot modify header information - headers already sent iis, php header(\refresh:0;url, header refresh cannot modify header information - headers already sent by, webcalendar \redirecting to.. here.\

Alle Zeitangaben in WEZ +1. Es ist jetzt 19:54 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.