I changed the order of the last two lines, but still have not achieved what I need. It now takes me to a plain page that says: "Unknown browser type". The code in the if block is executed, and the previous loop no longer occurs....