|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Cannot modify header information
Hi:
I’m a complete neophyte to PHP. I’m trying to set up a redirect page. I uploaded a test page so that when someone goes to: www.silverplatterstocks.com/genericpagetest.php I want them to be redirected to www.silverplatterstocks.com/redirectedpage.php Here is the code I used for the first page: <html> <head> <title>Generic</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php header("Location: http://www.silverplatterstocks.com/redirectedpage.php"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; ?> </body> </html> Then, when I browse to www.silverplatterstocks.com/genericpagetest.php I get the following error message: Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site242/fst/var/www/html/genericpagetest.php:9) in /home/virtual/site242/fst/var/www/html/genericpagetest.php on line 10 Line 9 is the line that begins with <?php and line 10 with “header” above. What am I doing wrong? Bob DM |
|
#2
|
|||
|
|||
|
RE: Cannot modify header information
in your example
i think this simple html code can help <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/index.html"> |
|
#3
|
|||
|
|||
|
RE: Cannot modify header information
Thank you, asim0s.
That worked fine. Bob DM |
|
#4
|
|||
|
|||
|
RE: Cannot modify header information
Your PHP would have worked if you hadn't had all the html around it. A file simply containing:
<?php header("Location: http://www.silverplatterstocks.com/redirectedpage.php"); exit; ?> and nothing else (no spaces outside of the php brackets, etc) will work fine. Once you start transmitting the file from the server you can no longer change the headers. |
|
#5
|
|||
|
|||
|
RE: Cannot modify header information
ahuahuahuaa in them we are great animals we do not have web to master by that the system of the news was modified
|
|
#6
|
|||
|
|||
|
RE: Cannot modify header information
ahuahuahuaa in them we are great animals we do not have web to master by that the system of the news was modified
|
|
#7
|
|||
|
|||
|
RE: Cannot modify header information
Really thanks, im trying for more than 3 days to fix this problem, and it worked finally, really thamks again.
|
|
#8
|
||||
|
||||
|
RE: Cannot modify header information
wow 2 year bump!
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > Cannot modify header information |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|