22-01-2018, 12:44 AM
السلام عليكم
PHP كود :
var
HTTP: THTTPClient;
Params: TStringList;
Response, Token: string;
P: Integer;
begin
HTTP := THTTPClient.Create;
Params := TStringList.Create;
try
Response := HTTP.Get('https://uploadfiles.io/login').ContentAsString;
P := Pos('"csrf_test_name" value="', Response);
if P > 0 then
begin
Token := Copy(Response, P + Length('"csrf_test_name" value="'), 32);
Params.Add('csrf_test_name=' + Token);
Params.Add('email=xxx@xxx.xxx');
Params.Add('password=*******');
HTTP.Post('https://uploadfiles.io/login', Params);
Response := HTTP.Get('https://uploadfiles.io/dashboard').ContentAsString;
if Pos('"fa fa-sign-out"', Response) > 0 then
ShowMessage('Logged in successfully.');
end;
finally
HTTP.Free;
Params.Free;
end;
end;
سبحان الله وبحمده سبحان الله العظيم


![[-]](https://delphi4arab.net/forum/D4A2020/collapse.png)