Baz has asked for the wisdom of the Perl Monks concerning the following question:

Hi, When I click on the submit button generated by the code below, instead of executing d.pl the download prompt is displayed, why?
print startform(-action=>'d.cgi',-target=>'_top'),table(Tr(\@table_con +t)),submit(-name=>'Submit'),reset(-name=>'Reset'),end_form;

Replies are listed 'Best First'.
Re: CGI.pm - forms
by strfry() (Monk) on Nov 16, 2001 at 01:19 UTC
    have you checked your web server's configuration? if you're the sysadmin, be certain that you've properly set ExecCGI (or set PerlHandler in case of mod_perl). If you're not the admin, but still have access to the config files, peek in there and be certain .cgi is allowed as an extention, as well as ExecCGI etc.

    and if neither of these cases are true, bug your local sysadmin for some helpful support. (:

    -- strfry()
    "Now with 50% more calories!"
Re: CGI.pm - forms
by tadman (Prior) on Nov 16, 2001 at 00:56 UTC
    No header?
    # Print the CGI header print header(); # ... Then do everything else here
    Without the header, it might not be sent as "text/html" but "application/x-perl" or something even more strange. This unknown type prompts the browser to ask where to save it.

    Also, is it 'd.pl' or 'd.cgi'?
      This is just a piece of the code and its d.cgi, sorry.