if
moritz' recommendation fails to work without adding the
http://localhost/ you've just shown us (when invoking the cgi ) you may have a problem with your Apache install... but from your OP, if your remark that "
i access it through my html link from the html page" means that you bring up the html page without using Apache (by, for example, typing
(drive:/// or file:///)path/to/htmlfilename.htm in the browser address bar without specifying
localhost, you're again trying to execute the cgi without any means (namely, Apache) to do so.