in reply to Problem with cgi script

Check the logfiles of your apache webserver, they normally are in /var/log/apache2/. Also firefox can show you the source text of the page it shows (right klick on the page to get a menu). Do you see a correct html page there?