Mega Code Archive

 
Categories / Delphi / .NET
 

How to code a simple win cgi using wintypes

Title: How to code a simple win-cgi using wintypes Uses wintypes; procedure TForm1.FormShow(Sender: TObject); var c,a,Name,Email:string; b:integer; begin name :=''; email :=''; { "a" contains the commandline passed by the web server program. } a:=ParamStr(1); { parsing... } for b:=1 to length(a) do begin c:=copy(a,b,1); if (c='&') and (name='') then begin name:=copy(a,6,b-6); email:=copy(a,b+7,length(a)-(b+6)); end; end; {The following codes sends HTML code to the hosts browser with the information you want them to see. You need to know HTML coding. } if (name='') or (email='') then begin writeln; writeln(' '); writeln(''); writeln('Untitled Normal Page'); writeln(''); writeln(''); writeln('My Home'); writeln('Inc.'); writeln('Your'); writeln('request to be placed onto our mailing list has been REJECTED'); writeln('This was due to your details not entered correctly'); writeln(' ); writeln(' color="#FFFFFF" size="3" face="Arial"[Return To My Home'); writeln(' ]'); writeln(' ); writeln(' color="#FFFFFF" size="3" face="Arial"[Return and try'); writeln(' again]'); writeln(''); writeln(' '); writeln(''); writeln(''); close; end Else Begin writeln; writeln(' '); writeln(''); writeln('Untitled Normal Page'); writeln(''); writeln(''); writeln('My Home'); writeln(' Inc.'); writeln('Your'); writeln('request to be placed onto our mailing list has been accepted'); writeln(''); writeln(' Your'); writeln(' Details Are'); writeln(' Name:'); writeln(' '+name+''); writeln(' Email Address: '+email+''); writeln(' ); writeln(' color="#FFFFFF" size="3" face="Arial"[Return To My Home Inc.'); writeln(' ]'); writeln(''); writeln(' '); writeln(''); writeln(''); close; end; End;