Go Back   CP Web Hosting - reseller hosting > Server Scripting > PHP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-29-2007, 09:37 AM
Senior Member
 
Join Date: Apr 2007
Posts: 311
Default header problem

If I do a header("Location: http://xyz.com") does that get sent to the browser immediately? In other words, can I then do other stuff after the header command without worrying about delaying the redirect to the browser?
Reply With Quote
  #2 (permalink)  
Old 06-29-2007, 09:38 AM
Senior Member
 
Join Date: Mar 2007
Posts: 193
Default

Quote:
Originally Posted by Axe Solutions View Post
If I do a header("Location: http://xyz.com") does that get sent to the browser immediately? In other words, can I then do other stuff after the header command without worrying about delaying the redirect to the browser?
use htaccess to redirect
Reply With Quote
  #3 (permalink)  
Old 06-29-2007, 09:39 AM
Senior Member
 
Join Date: Apr 2007
Posts: 347
Default

You have to do what you have to do before the header Location thing or, you can use meta refresh with a small delay.
Reply With Quote
  #4 (permalink)  
Old 06-29-2007, 09:42 AM
Senior Member
 
Join Date: Apr 2007
Posts: 311
Default

I wants to redirect and some code executed. How do you do that with .htaccess?
Reply With Quote
  #5 (permalink)  
Old 06-29-2007, 09:44 AM
Senior Member
 
Join Date: May 2007
Posts: 217
Default

htaccess is not always the best choice. In forums like phpBB the header function is used because they first need to check if for example a user is logged in or not. Then it's so much easier to use the header function.
Reply With Quote
  #6 (permalink)  
Old 06-29-2007, 09:45 AM
Senior Member
 
Join Date: Mar 2007
Posts: 193
Default

Quote:
Originally Posted by Axe Solutions View Post
I wants to redirect and some code executed. How do you do that with .htaccess?

code 2 be executed.....
header("Location: somepage.php");
exit
Reply With Quote
Reply


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:12 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0