User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 375,223 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,235 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 201 | Replies: 3
Reply
Join Date: Dec 2007
Posts: 14
Reputation: webguru07 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
webguru07 webguru07 is offline Offline
Newbie Poster

modify headers

  #1  
May 7th, 2008
I know this question has come up before and i've researched headers and i know that you can't output anything to the browser then change the headers, so my question is, is there a way to redirect with PHP inside a HTML document?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2008
Location: UK
Posts: 51
Reputation: xan is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
xan's Avatar
xan xan is offline Offline
Junior Poster in Training

Re: modify headers

  #2  
May 7th, 2008
The only way to do this would be to have the header() at the top, before any output on the page.

What exactly are you trying to do?
Last edited by xan : May 7th, 2008 at 4:42 pm.
Reply With Quote  
Join Date: Jul 2006
Location: Remunj
Posts: 142
Reputation: pritaeas is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 16
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Junior Poster

Re: modify headers

  #3  
May 7th, 2008
Maybe you can output a javascript function that can redirect, and put the call in html when necessary.
Reply With Quote  
Join Date: Nov 2007
Location: Arkansas
Posts: 259
Reputation: buddylee17 is on a distinguished road 
Rep Power: 1
Solved Threads: 45
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Whiz in Training

Re: modify headers

  #4  
May 7th, 2008
echo a meta refresh in the head of the document if certain conditions exist.
  1. if(empty($_SESSION['ID'])){
  2. echo'<meta http-equiv="refresh" content="0;url=http://www.yoursite.com/newpage.htm" />';
  3. }
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 3:43 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC