php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33472 header redirection at the middle of PHP+HTML file
Submitted: 2005-06-25 13:08 UTC Modified: 2005-07-06 21:34 UTC
Votes:2
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tarun27in at gmail dot com Assigned:
Status: Not a bug Package: PHP-GTK related
PHP Version: 4.3.10 OS: Windows Xp
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tarun27in at gmail dot com
New email:
PHP Version: OS:

 

 [2005-06-25 13:08 UTC] tarun27in at gmail dot com
Description:
------------
Though I m not a php guru but still i have been obsessed with a big with header location which often troubles me a lot , I often use html tags in php file as i use dreamweaver as html editor and whenever i want to redirect to some remote url in the middle of the page it always prompt me of a warning that headers already sent , i have researched a lot but didn't find any satisfactory solutions. Though i was able to redirect via javascript href tag but i think thats quite a bug as I also designed sites on ASP and response.redirect works anywhere in a file.

Just want to take in to your considerations.

thanks and regards
TARUN SHARMA


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-05 12:19 UTC] timo dot schmid at gmail dot com
This is not a Bug, this is becaus the Headers of your Page MUST been sent BEFORE you output any Text/Html.
Use the following instead:
<script type="text/javascript">
document.location = 'http://www.php.net';
</script>
 [2005-07-05 12:24 UTC] tarun27in at gmail dot com
dude , i m already doin that way , but this is not a permanent solution in PHP , like the way u have in ASP response.redirect which does not give any header sent error there shud be something through which u can redirect even at the middle of the page withour caring for whats sent and whats not.

Anyways thanks for ur reply.

Cheers
 [2005-07-05 13:07 UTC] timo dot schmid at gmail dot com
Hi again, I found about the response.redirect that it sends a HTML-Header with a <meta> tag. If you do this AFTER outputting any data (except headers) you will get a document that is NOT valid HTML/XHTML or whatever. Not beautyful. As I think, JS is the only Possibility to make it conform.
 [2005-07-06 21:34 UTC] edink@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Feb 25 07:01:26 2020 UTC