Reply
redirecting page
Old 03-27-2006, 05:04 AM redirecting page
numbenator's Avatar
Ultra Talker

Posts: 411
Location: London
Hi there.
I have a php if else for which when else, i want to rediretc the user to a different page.

How do i do this.

when i use header("location: http://www.thefirstpost.com/"); , i get the error Warning: Cannot modify header information - headers already sent by (output started at E:\inetpub\vhosts\pnets.org\httpdocs\php\redirect. php:9) in E:\inetpub\vhosts\pnets.org\httpdocs\php\redirect. php on line 11

which would seem logical however i cant find an alternative
__________________
www.mastech-solutions.com

Last edited by numbenator : 03-27-2006 at 05:08 AM.
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
When You Register, These Ads Go Away!
Old 03-27-2006, 05:07 AM Re: redirecting page
Super Talker

Posts: 144
you need to make sure you don't output put content before the header is set. one way would be to construct a variable with your content and echo it out in one place. also, if done correctly, this type of checking should be at the top of your code before content is flushed anyways.

paste your code, perhaps you'll get a better response.
__________________
create.vibe
web development portfolio
createvibe.com is offline
Reply With Quote
View Public Profile Visit createvibe.com's homepage!
 
Old 03-27-2006, 05:12 AM Re: redirecting page
numbenator's Avatar
Ultra Talker

Posts: 411
Location: London
hi there,

problem is, php process is in middle of page though and cant process in header.

I tried echo "http://www.thefirstpost" but it obviously just outputs the text.

using asp id response.redirect and thought there would be an alternative.

any more ideas
__________________
www.mastech-solutions.com
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 03-27-2006, 05:18 AM Re: redirecting page
Super Talker

Posts: 144
nope, you need to seperate your processing from your output when using checks like this. only thing else would be to set a flag and use a META or JS redirect client side, but eww.
__________________
create.vibe
web development portfolio
createvibe.com is offline
Reply With Quote
View Public Profile Visit createvibe.com's homepage!
 
Reply     « Reply to redirecting page
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11544 seconds with 12 queries