Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old October 3rd, 2005, 11:25 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #2  
Old October 4th, 2005, 12:54 PM
asim0s asim0s is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: nicosia,cyprus
Posts: 48 asim0s User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 3 m 31 sec
Reputation Power: 2
Send a message via ICQ to asim0s Send a message via Yahoo to asim0s
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">

Reply With Quote
  #3  
Old October 4th, 2005, 02:52 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Cannot modify header information

Thank you, asim0s.

That worked fine.

Bob DM

Reply With Quote
  #4  
Old October 18th, 2005, 03:30 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #5  
Old October 19th, 2005, 02:12 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #6  
Old October 19th, 2005, 02:12 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #7  
Old January 28th, 2007, 07:01 AM
free palestine free palestine is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: palestine
Posts: 1 free palestine User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to free palestine Send a message via Yahoo to free palestine
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.

Reply With Quote
  #8  
Old January 28th, 2007, 07:29 AM
HinDRAncE's Avatar
HinDRAncE HinDRAncE is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Mex city
Posts: 58 HinDRAncE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 22 m 38 sec
Reputation Power: 2
Send a message via ICQ to HinDRAncE Send a message via AIM to HinDRAncE Send a message via Yahoo to HinDRAncE
RE: Cannot modify header information

wow 2 year bump!

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > Cannot modify header information


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway