Does header("location: www.newsite.com"); work AL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: cant with php

Post by Roja »

yakasha wrote:You can't do what you're wanting to do with php for a couple reasons.

1) Nothing is sent to the the client until after your script is completely finished executing. This means putting Sleep() calls in your code will only accomplish one thing: Your viewers will think your site is really slow.
Thats not entirely accurate. You can (using flush), send output during script execution - as long as no other form of output buffering or compression is active. (Most people dont realize that, because the majority of hosts have one or the other in effect).
Post Reply