note 52655 added to function.header
| From: | wil1488 at gmail dot com | Date: | Sun, 08 May 2005 22:22:44 +0000 |
| Subject: | note 52655 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89130@lists.php.net to get a copy of this message | ||
vernonj
said abolt the problem:
'Warning: Cannot modify header information - headers already sent by'
and the solution is use:
<? echo "<script> self.location(\"file.php\");</script>"; ?>
i think the better method is use:
<?
print("<script
type="text/javascript">window.location=\"file.php\"</script>");
?>
// i use print, but echo works great! :)
i tested this method to redirect on Opera and Internet Explorer, maybe works on all browsers!
This method of redirect with javascript i found on: http://www.w3schools.com/js/tryit.asp?filename=tryjs_crossbrowser
Thanks !
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52655
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52655&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52655&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52655&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52655&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52655&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52655&report=yes
Search -- http://master.php.net/manage/user-notes.php