header() question

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

Post Reply
Death
Forum Newbie
Posts: 17
Joined: Tue Apr 19, 2005 11:52 am

header() question

Post 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.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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).
Post Reply