It's probably a configuration issue with your webserver, or incorrect placement of the script within your server's filestructure. If the server is properly configured, and the script is where it belongs, or otherwise identified as a CGI script such that your webserver knows what to do with it, there should be no way for any sort of browser (mis)configuration to ever see the actual code behind the CGI script.

It's the web server's responsibility to execute a CGI script. If it's failing to do so, it's not the browser's fault. Somehow you're not identifying to your webserver that the CGI script is a CGI script. Instead, it's thinking it is just some file, and handing it un-executed to the browser. The browser reacts by asking if you want to save this file.

The second issue is that of your error message when you run it from the command line:

Undefined subroutine &main::pram called at ./Write.cgi line 15

Unless your script defines a subroutine named pram(), my guess is that you really mean to be calling param() on line 15 of your script named Write.cgi.


Dave


In reply to Re: CGI wants to save file? by davido
in thread CGI wants to save file? by loop362

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.