-


Input Queries - 3


Delete(Data,i+1,2);

Data[i] := Chr(StrToInt(Str))

end

end;

if i > 0 then Data[i+1] := '&'

else Data := '&'

finalization

Data := ''

end.

CGI DrBobCGI : CGI - (guestbook), , .

CGI :

<HTML>

<BODY>

<H2>Dr.Bob's Guestbook</H2>

<FORM ACTION=http://www.drbob42.com/cgi-bin/guest.exe

METHOD=POST>

Name: <INPUT TYPE=text NAME=name><BR>

Comments: <TEXTAREA COLS=42 LINES=4 NAME=comments>

<P>

<INPUT TYPE=SUBMIT VALUE="Send Comments to

Dr.Bob">

</FORM>

</BODY>

</HTML>

:

program CGI;

{$I-}

{$APPTYPE CONSOLE}

uses

DrBobCGI;

var

guest: Text;

Str: String;

begin

Assign(guest,'book.htm'); // assuming that's the guestbook

Append(guest);

if IOResult <> 0 then // open new guestbook

begin

Rewrite(guest);

writeln(guest,'<HTML>');

writeln(guest,'<BODY>')

end;

writeln(guest,'Date: ',DateTimeToStr(Now),'<BR>');

writeln(guest,'Name: ',Value('name'),'<BR>');

writeln(guest,'Comments: ',Value('comments'),'<HR>');

reset(guest);

while not eof(guest) do // now output guestbook itself

begin

readln(guest,Str);

writeln(Str)

end;

close(guest);

writeln('</BODY>');

writeln('</HTML>')


end.

:

"submit" , , . , .

:

"type=submit", :

<HTML>

<BODY>

Edit the information and press the SAVE button<BR>

To Delete information, press the DELETE button<BR>

<P>

<FORM METHOD=POST ACTION=http://www.drbob42.com/cgi-bin/debug.exe>

<HR>

<input type=text name=name>

<P>

<input type=reset value="RESET">

<input type=submit name=action value="SAVE">

<input type=submit name=action value="DELETE">

</FORM>

</BODY>

</HTML>

"Action=SAVE" "Action=DELETE" .