header("location:... headed nicht – SELFHTML-Forum Forum als Ergänzung zum SELFHTML-Wiki und zur Dokumentation SELFHTML https://forum.selfhtml.org/self header("location:... headed nicht Wed, 13 Sep 06 06:30:06 Z https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021224#m1021224 https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021224#m1021224 <p>Hallo,</p> <p>ich möchte am Ende eines Skriptes ein Weiteres aufrufen. Leider bekomme ich folgende Fehlermeldung:</p> <p>Warning: Cannot modify header information - headers already sent by (output started at D:...\admin\add\object\process.php:5) in D:...\admin\add\object\process.php on line 21</p> <p>Der Aufruf sieht so aus:</p> <p>header ("Location:index.php".$link_ext);</p> <p>Dieser Aufruf funktionierte bisher auf meinem Webserver, hier lokal (XAMPP) nun nicht mehr. Warum?</p> <p>Danke und Gruss</p> header("location:... headed nicht Wed, 13 Sep 06 06:37:27 Z https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021231#m1021231 https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021231#m1021231 <p>Hallo,</p> <blockquote> <p>Warning: Cannot modify header information - headers already sent by (output started at D:...\admin\add\object\process.php:5) in D:...\admin\add\object\process.php on line 21</p> </blockquote> <p><a href="http://www.google.at/search?hl=de&q=headers+already+sent" rel="nofollow noopener noreferrer">http://www.google.at/search?hl=de&q=headers+already+sent</a></p> <p>Gruß,<br> Severin</p> <div class="signature">-- <br> They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.<br> -- Benjamin Franklin </div> header("location:... headed nicht Wed, 13 Sep 06 06:48:32 Z https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021225#m1021225 https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021225#m1021225 <p>Hi,</p> <blockquote> <p>header ("Location:index.php".$link_ext);</p> </blockquote> <p>egal was in $link_ext steht: An "index.php" angefügt wird es nie zu einer absoluten URL - zumindest mit keinem Protokoll, das ein mir bekannter HTTP-Client unterstützen würde. Somit ist dieser Code defekt.</p> <p>Cheatah</p> <div class="signature">-- <br> X-Self-Code: sh:( fo:} ch:~ rl:° br:> n4:& ie:% mo:) va:) de:] zu:) fl:{ ss:) ls:~ js:|<br> X-Self-Code-Url: http://emmanuel.dammerer.at/selfcode.html<br> X-Will-Answer-Email: No<br> X-Please-Search-Archive-First: Absolutely Yes </div> header("location:... headed nicht Wed, 13 Sep 06 07:36:17 Z https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021226#m1021226 https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021226#m1021226 <p>Hi Cheatah,</p> <blockquote> <p>egal was in $link_ext steht: An "index.php" angefügt wird es nie zu einer absoluten URL - zumindest mit keinem Protokoll, das ein mir bekannter HTTP-Client unterstützen würde.</p> </blockquote> <p>Es geht aber. Warum sollte es nicht?</p> <p>Gruss</p> header("location:... headed nicht Wed, 13 Sep 06 08:36:11 Z https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021229#m1021229 https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021229#m1021229 <p>Hi,</p> <blockquote> <p>Es geht aber.</p> </blockquote> <p>"es geht" war bei der Software-Entwicklung noch niemals von einer wie auch immer gearteten Relevanz (im Gegensatz zu "es geht nicht"). "Es ist falsch" hingegen ist ein Ausschlusskriterium.</p> <blockquote> <p>Warum sollte es nicht?</p> </blockquote> <p>Weil <a href="http://www.ietf.org/rfc/rfc2616.txt" rel="nofollow noopener noreferrer">RFC 2616</a> dies sehr, sehr klar verbietet:</p> <p>Location       = "Location" ":" absoluteURI</p> <p>Cheatah</p> <div class="signature">-- <br> X-Self-Code: sh:( fo:} ch:~ rl:° br:> n4:& ie:% mo:) va:) de:] zu:) fl:{ ss:) ls:~ js:|<br> X-Self-Code-Url: http://emmanuel.dammerer.at/selfcode.html<br> X-Will-Answer-Email: No<br> X-Please-Search-Archive-First: Absolutely Yes </div> header("location:... headed nicht Wed, 13 Sep 06 08:37:53 Z https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021227#m1021227 https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021227#m1021227 <p>Hi,</p> <blockquote> <p>Es geht aber. Warum sollte es nicht?</p> </blockquote> <p>gehen tut vieles, das macht es noch lange nicht richtig. Du baust dabei aber auf automatische Fehlerkorrektur der Browser. Das mag augenscheinlich gehen, es kann aber auch zu unerwünschten Ergebnissen führen wenn ein Client mal nicht so reagiert wie von dir erwartet.<br> Wie dir auch das <a href="http://de2.php.net/header" rel="nofollow noopener noreferrer">Manual</a> an entsprechender Stelle sagt, musst du laut HTTP-Protokoll eine absolute URL angeben.</p> <p>MfG<br> Rouven</p> <div class="signature">-- <br> -------------------<br> There's no such thing as a free lunch  --  Milton Friedman </div> header("location:... headed nicht Wed, 13 Sep 06 15:14:53 Z https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021228#m1021228 https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021228#m1021228 <p>Hi Rouven,</p> <blockquote> <p>es kann aber auch zu unerwünschten Ergebnissen führen</p> </blockquote> <p>Und das wollen wir doch alle nicht, oder? ;-)</p> <blockquote> <p>Wie dir auch das <a href="http://de2.php.net/header" rel="nofollow noopener noreferrer">Manual</a> an entsprechender Stelle sagt, musst du laut HTTP-Protokoll eine absolute URL angeben.</p> </blockquote> <p>1000 Dank. Solche Hinweise sind echt wertvoll. Ich hätte es sonst ohne absoluten Link gelassen.</p> <p>Gruss</p> header("location:... headed schon lange wieder Wed, 13 Sep 06 15:21:58 Z https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021230#m1021230 https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021230#m1021230 <p>Hallo Cheatah,</p> <blockquote> <p>Weil <a href="http://www.ietf.org/rfc/rfc2616.txt" rel="nofollow noopener noreferrer">RFC 2616</a> dies sehr, sehr klar verbietet:</p> <p>Location       = "Location" ":" absoluteURI</p> </blockquote> <p>Auf Dich ist wieder Verlass, danke. Ist ja auch kein Problem, wenn man daran denkt. Das werde ich in Zukunft immer.</p> <p>Doch fällt mir auf, dass Du in letzter Zeit etwas brummig klingst. Bist Du vielleicht urlaubsreif?</p> <p>Ich wünsch Dir auf alle Fälle noch eine wunderhübschen Tag.</p> <p>und Gruss</p> header("location:... headed jetzt wieder Wed, 13 Sep 06 07:29:11 Z https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021232#m1021232 https://forum.selfhtml.org/self/2006/sep/13/header-location-headed-nicht/1021232#m1021232 <p>Hallo Severin,</p> <p>danke, ich hatte tatsächlich Ausgaben vorher drin. Jetzt funzzt es ordentlich.</p> <p>Danke und Gruss</p>