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;
}