nezbo Posted July 24, 2007 Share Posted July 24, 2007 Hi all I am trying to Redirect from one page to another and it wont let me use... header( 'Location: http://www.yoursite.com/new_page.html' ) ; so is there any other way of doing this ? Neil Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted July 24, 2007 Share Posted July 24, 2007 make sure there is no output yet on the browser before using header(); or you can use javascript to redirect Quote Link to comment Share on other sites More sharing options...
Fadion Posted July 25, 2007 Share Posted July 25, 2007 As vbnullchar said you must use 'header' before sending any output to the browser. An alternative could be the meta refresh which is as following: <meta http-equiv="refresh" content="0;URL=http://www.phpfreaks.com" /> Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted July 25, 2007 Share Posted July 25, 2007 I recommend javascript over meta refresh. You can easily find any examples by googling (Javascript refresh). Quote Link to comment Share on other sites More sharing options...
plutomed Posted July 25, 2007 Share Posted July 25, 2007 if you ever have a header(); after any HTML it won't work, you have to put: <? ob_start(); ?> before all code and: <? ob_end_flush(); ?> after all code. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.