pliant Posted December 19, 2007 Share Posted December 19, 2007 I was asked to make a page that would register with Opentracker before redirecting to the main page of our site. I put this script up on one of our servers running php 5.1.6, and to my very great surprise, it worked: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Tracking Title</title> </head> <body> <!-- OPENTRACKER HTML START --> <script defer src="http://server1.opentracker.net/?site=www.thesite.com"></script> <noscript><a href="http://www.opentracker.net" target="_blank"><img src="http://img.opentracker.net/" alt="page counter" border="0"></a></noscript> <!-- OPENTRACKER HTML END --> </body> </html> <?php header('location: http://www.thesite.com') ;?> It also works on another server running the same version of php. On an alternate server, still running 4.3.11, it gave the expected 'headers already sent' error. Can anyone explain to me why does this script works on two of my servers? I looked through the header() manual page and was unable to find any php5 updates that would account for this. Thanks for reading. Quote Link to comment Share on other sites More sharing options...
corbin Posted December 19, 2007 Share Posted December 19, 2007 Most likely buffering is enabled by default, meaning session_start(), header() and setcookie() could be anywhere. Just a guess. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.