arotton
asked on
TWebBrowser postdata
I need to open a new web page from a program in delphi
and send post login info
example postdata will be pass=pass login=login
WebBrowser1.OleObject.Navi gate('http://xxxxxx.com/testme.php',1,'', postdata);
opens the page but sends no postdata
how is this done?
i am looking for any way in delphi to open a new browser and send the postdata
and send post login info
example postdata will be pass=pass login=login
WebBrowser1.OleObject.Navi
opens the page but sends no postdata
how is this done?
i am looking for any way in delphi to open a new browser and send the postdata
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
http://dn.codegear.com/article/26531
was what i am looking for
------
procedure TForm1.Button5Click(Sender
var
EncodedDataString: string;
PostData: OleVariant;
Headers: OleVariant;
I: Integer;
begin
// First, create a URL encoded string of the data
EncodedDataString := 'login=login' + '&pass=sss' ;
// The PostData OleVariant needs to be an array of bytes as large
// as the string (minus the NULL terminator)
PostData := VarArrayCreate([0, Length(EncodedDataString) - 1], varByte);
// Now, move the Ordinal value of the character into the PostData array
for I := 1 to Length(EncodedDataString) do
PostData[I-1] := Ord(EncodedDataString[I]);
Headers := 'Content-Type: application/x-www-form-url
// Finally, we just Navigate to the URL. Note that you may have to modify
// the path to your ASP page's location.
WebBrowser1.Navigate('http://xxxxx.com/testme.php', 1,EmptyParam, PostData, Headers);
end;