unit MainFrm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtrls, SHDocVw, ComCtrls;
type
TForm1 = class(TForm)
lblFlavor: TLabel;
edtFormName: TEdit;
btnSubmit: TButton;
Tarayici1: TWebBrowser;
edtName: TEdit;
edtEmail: TEdit;
Label1: TLabel;
edtWebSyf: TEdit;
Label2: TLabel;
edtBlnYer: TEdit;
Label3: TLabel;
edtilanKts: TRichEdit;
Label4: TLabel;
Button1: TButton;
Label5: TLabel;
Label6: TLabel;
procedure btnSubmitClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses HTTPApp;
{$R *.DFM}
procedure TForm1.btnSubmitClick(Sender: TObject);
var
EncodedDataString: string;
PostData: OleVariant;
Headers: OleVariant;
I: Integer;
begin
EncodedDataString := 'guest_name=' + HTTPEncode(edtFormName.Text) + '&' +
'guest_opt1=' + HttpEncode(edtName.Text) + '&' +
'guest_email=' + HttpEncode(edtEmail.Text) + '&' +
'guest_URL=' + HttpEncode(edtWebSyf.Text) + '&' +
'guest_address=' + HttpEncode(edtBlnYer.Text) + '&' +
'guest_comments=' + HttpEncode(edtilanKts.Text);
PostData := VarArrayCreate([0, Length(EncodedDataString) - 1], varByte);
for I := 1 to Length(EncodedDataString) do
PostData[I-1] := Ord(EncodedDataString[I]);
Headers := 'Content-Type: application/x-www-form-urlencoded' + #10#13;
Tarayici1.Navigate('http://www.kayahan.itgo.com/cgi-bin/guest', EmptyParam,
EmptyParam, PostData, Headers);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
end.
Anil KAYAHAN