View Full Version : How does PostHTTPPage work?
Yea, I'm trying to figure out how to make it post to a page.
Thanks
Mat
PostHTTPPage takes 3 parameters. The first one is an integer returned from InitializeHTTPClient. The second one is the URL that you're posting to. The third parameter is the post string such as 'a=b&c=d'.
You should use PostHTTPPageEx and AddPostVariable instead though :).
Like this?
var
S:string;
begin
S := 'gay';
PostHTTPPageEx(0,'www.loloo.com');
AddPostVariable(0,s,s);
end.
?
Like this?
var
S:string;
begin
S := 'gay';
PostHTTPPageEx(0,'www.loloo.com');
AddPostVariable(0,s,s);
end.
?
No, PostHTTPPage(Ex) actually posts to the page. You also need InitializeHTTPClient.
var
Client : integer;
begin
Client := InitializeHTTPClient(False);
AddPostVariable(Client, 'gay', 'gay');
postHTTPPageEx(Client, 'www.loloo.com');
FreeHTTPClient(Client);
end.
Would work the same as
var
Client : integer;
begin
Client := InitializeHTTPClient(False);
PostHTTPPage(Client, 'www.loloo.com', 'gay=gay');
FreeHTTPClient(Client);
end.
I get a error with:
Client := InitializeHTTPClient(False); and I'm still unsure what the Post is posting, as such.
I get a error with:
Client := InitializeHTTPClient(False); and I'm still unsure what the Post is posting, as such.
What do you mean? It would be helpful if you could tell me the error you are receiving.
[Error] (8:40): Invalid number of parameters at line 7
Compiling failed.
E:and basiclly I have a website, and I want to post something to it, but I don't like the idea of it being a open post.
Dgby714
03-18-2012, 06:10 PM
SRL overrides it, use Wrap instead.
I get no errors with the code I posted...what version of Simba are you using?
Edit: Nevermind.
Simba is released under the GPL license.
You are currently using version: 984
Compiled with FPC version 2.4.4
Please report bugs at: http://bugs.villavu.com/
E:only when i include SRL wt?
As Dgby said, use InitializeHTTPClientWrap instead.
E:and basiclly I have a website, and I want to post something to it, but I don't like the idea of it being a open post.
What do you mean open post?
Zyt3x
03-18-2012, 06:15 PM
I get a error with:
Client := InitializeHTTPClient(False); and I'm still unsure what the Post is posting, as such.
try
Client := InitializeHTTPClient(False, False);
AddPostVariable will add a post-variable to the web client.
Read more about Post-variables here: https://en.wikipedia.org/wiki/POST_(HTTP) and here
http://en.wikipedia.org/wiki/Post/Redirect/Get
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.