redirect user, then log his visit using php and mysql
        Posted  
        
            by Bart van Heukelom
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Bart van Heukelom
        
        
        
        Published on 2009-04-01T18:48:47Z
        Indexed on 
            2010/04/14
            5:53 UTC
        
        
        Read the original article
        Hit count: 479
        
I have a PHP redirect page to track clicks on links. Basically it does:
 - get url from $_GET
 - connect to database
 - create row for url, or update with 1 hit if it exists
 - redirect browser to url using Location: header
I was wondering if it's possible to send the redirect to the client first, so it can get on with it's job, and then log the click. Would simply switching things around work?
© Stack Overflow or respective owner