#33472 [Com]: header redirection at the middle of PHP+HTML file
| From: | timo dot schmid at gmail dot com | Date: | Tue, 05 Jul 2005 11:07:09 +0000 |
| Subject: | #33472 [Com]: header redirection at the middle of PHP+HTML file | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-1418@lists.php.net to get a copy of this message | ||
ID: 33472
Comment by: timo dot schmid at gmail dot com
Reported By: tarun27in at gmail dot com
Status: Open
Bug Type: PHP-GTK related
Operating System: Windows Xp
PHP Version: 4.3.10
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2005-07-05 12:24:18] 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 12:19:16] 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-06-25 13:08:42] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33472&edit=1