We want to pass input parameters and upload a file from a web browser to an f77 fortran program on an Apache web server, but were unable to find much usefull information about doing so. Our goal is to use no libraries, no Perl, and nothing beyond standard f77 just as it comes with FreeBSD. There are some limitations due to the lack of generality in f77 I/O, but it does do what we need quite straightforwardly and in only a few lines of code.
Here is an example of a page asking for two values,passing them to a fortran program which writes an HTML response:
and might expect the page to be finished, the user sees the browser showing a busy condition, right until the CGI process (and any subprocesses) finally exit. That may be a function of our web server (Apache). This hasn't been my experience, nor can either of us understand what the difference in systems might be.
Another correspondent reports that his Intel compiler read statement is unable to read the standard input from the Microsoft web server. However, the getc function does work for him.
Recently I have been working with this and found the content-type line no longer showing the field name. I am not sure why this is so. Also, I notice that unchecked checkboxes do not show up in the standard input at all - making checkboxes unusable. Radioboxes do work.
An online version of echo.for is available at http://www.nber.org/sys-admin/fortran-cgi/echo.cgi (not a hot link) where you can use it for testing purposes. Just change the href in your web page to point to that page and and our server will echo back to you whatever the browser sends it. Sort of like a reverse "show source".
National Bureau of Economic Research
feenberg isat nber dotte org
Sources and more information: