Subject: | |
From: | |
Reply To: | |
Date: | Sun, 14 May 2000 00:27:47 +0200 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Richard wrote...
>Short answer: Don't use Pascal IO. Call FREAD and FWRITE as intrinsic.
Unless you use "MPE proglets" instead of CGI... In that case you
could code something like attached below, without having to worry
about CGI issues like "Posix pipe to parent httpd" or "multiple
CGI processes share a single web server job context"...
MPE proglets? Well, admittedly a bizarre approach. I simply was
curious, if a small Java Servlet could act as the "web glue". Also
see http://www.editcorp.com/Personal/Lars_Appel/JavaDemo/proglets/
for details and other examples. And feel free to ROTFL ;-)
Lars "it's not CGI any more"
---cut here---
program demo(input,output);
{ surf with something like http://yourhost/servlet/pasdemo/welcome }
var
http : string[10];
pathinfo : string[20];
querystring : string[80];
name : string[30];
age : string[10];
begin
repeat
prompt('HTTP> '); readln(http);
if http = 'GET' then
begin
prompt('PATHINFO> '); readln(pathinfo);
prompt('QUERYSTRING> '); readln(querystring);
writeln('<html>');
writeln('<title>MPE Proglet Demo</title>');
writeln('<h1>Welcome to my CI Proglet</h1>');
writeln('<p>PathInfo is ' + pathinfo + '</p>');
writeln('<p>QueryString is ' + querystring + '</p>');
writeln('<form method=POST action=/servlet/pasdemo/example>');
writeln('<p>Name');
writeln('<input type=text name=NAME size=30 value=default>');
writeln('</p>');
writeln('<p>Age');
writeln('<select name=AGE>');
writeln('<option value=Below30>below 30');
writeln('<option value=Above30>above 30');
writeln('</select>');
writeln('</p>');
writeln('<input type=submit>');
writeln('</form>');
writeln('<address>Lars Appel, May 2000</address>');
writeln('</html>');
end
else if http = 'POST' then
begin
prompt('PATHINFO> '); readln(pathinfo);
prompt('QUERYSTRING> '); readln(querystring);
prompt('NAME> '); readln(name);
prompt('AGE> '); readln(age);
writeln('<html>');
writeln('<title>MPE Proglet Demo</title>');
writeln('<h1>Thanks for your response</h1>');
writeln('<p>PathInfo is ' + pathinfo + '</p>');
writeln('<p>QueryString is ' + querystring + '</p>');
writeln('<p>Name is ' + name + '</p>');
writeln('<p>Age is ' + Age + '</p>');
writeln('<address>Lars Appel, May 2000</address>');
writeln('</html>');
end
else if http = 'EXIT' then
{ ignore here and exit the loop to unload the proglet }
else
begin
writeln('<html>');
writeln('<p>Unsupported method ' + http + '</p>');
writeln('</html>');
end
until http = 'EXIT'
end.
|
|
|