Page 1 of 1

header() question

Posted: Thu Apr 21, 2005 4:05 pm
by Death
Hi guys,

Does this look good:

Code: Select all

header("Location: $url");

// log that click in my database
That way the user goes right to the new site without a delay. The code after the header() call still gets executed right ?

Thanks.

Posted: Thu Apr 21, 2005 5:15 pm
by shiznatix
ya but remember, ob_start(); on the 1st line of the script if your looking for a bandaid approch to it, i mean have you even tested it? if it gives you errors there IS a reason for it, and there IS a sticky post about why it gives u errors. but other than that yes, it looks good (as long as $url is a valid url).