omgh4x0rz
2007-04-14 14:43:07
hey, I'm trying to figure out how to do an auth system using the PostHTTPPage. I'm not sure what I'm supposed to put for the client argument though. SRL stats uses SRLClient, but what is that actually…?
thanks
thanks
2007-04-14 14:43:07
2007-04-16 14:06:35
function Auth(username, password : string) : boolean;
var httpc : integer;
s : string;
begin
httpc := InitializeHTTPClient(false, false);
AddPostVariable(httpc, 'username', username);
AddPostVariable(httpc, 'password', password);
s := PostHTTPPageEx(httpc, 'http://youre.url.here.com/some.page.php');
if (s = 'AUTH ACCEPTED')
then result := true else result := false;
FreeHTTPClient(httpc);
end;
First it inits a HTTP Client, then add the post vars to it, and finally post the page with the vars and verify the string it returns.
2007-04-17 14:35:10
program InternetTest;
var
myclient:integer;
ret:string;
begin
myclient := InitializeHTTPClient( true, true );
ClearPostData(myclient);
AddPostVariable(myclient, 'auth', '666');
ret:=PostHTTPPageEx(myclient,'http://omgh4x0rz.freehostia.com/test.php');
writeln(ret);
FreeHTTPClient(myclient);
end.