I find it strange that a window opens when you access this code via a web browser, I copied it verbatim and all I get is "Premature end of script headers: ofornes.pl" in my error_log file. To be honest, this came as absolutely no surprise. So rather than repeat myself, please read and understand my
previous advice. Also check your browser configuration.
Martin