as far as I know you of course can use your header AND YOU SHOULD USE IT but you try to free a mysql_result after redirecting that can't work and for me this is the main error.
Do everything you need to do and then (at last) redirect using header!
Counting clickthru's on a news script
Moderator: General Moderators