Subject: | |
From: | |
Reply To: | |
Date: | Wed, 5 Feb 1997 15:54:58 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
After my first attempt to use a Pascal 'writeln' program for CGI under Apache
failed to open the 'output' file, I thought why not use the PRINT intrinsic
to write to the already open $STDLIST and hopefully stdout?
Well, that does the trick! The web server receives the output sent via the
PRINT intrinsic and returns it to the client web browser.
I then tried a simple READ/READX intrinsic test, but that hung the CGI program.
I may need to make the test more complex for it to be valid. (Of course,
anybody doing CGI input should really be using Perl due to all of the
public Perl CGI code that's available...)
I plan to experiment some more to see if I can get CGI input working, as well
as to see if I can figure out how to HPFOPEN stdout from an MPE program.
Here is my simple CGI output test program:
program CGI;
const
c_bufsize = 1024;
c_nl = CHR(10);
var
st : string[c_bufsize];
procedure PRINT; intrinsic;
begin
st := 'Content-type: text/html'+c_nl+c_nl;
PRINT(st,-STRLEN(st),0);
st := '<html><body><p>Hello world!</p></body></html>';
PRINT(st,-STRLEN(st),0);
end.
--
Mark Bixby E-mail: [log in to unmask]
Coast Community College Dist. Web: http://www.cccd.edu/~markb/
District Information Services 1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)
|
|
|