I doubt that this has to do with the code your posted. Check whether you have any header("location:...") commands in your code and whether they may be looping (i.e. redirecting to a page that again redirects to a page that redirects to a page).
It could also be a .htaccess file (or Apache configuration) containing mod_rewrite instructions with the [R] parameter creating an endless loop.
Pekka
2009-12-17 11:59:20