Hi, EveryBody!
I'm new to programming!
I need your help plz.
I've 2 project:
1. Project Login page. Using App Tethering and 2 buttons(Connect button =>connects to the server AND Login button=>Sends request to the Server to check Valid username and password).
2. Project Server page. In a Server Page using App tethering and FDQuery +(SQLite database test.db). When Client Connects to the Server and sends request to the Server to check valid username and password it gives wrong result. plz help me to make work correctly.
1 Project Code:
procedure TfAuth.bLogin(Sender: TObject);
begin
tAProfile.SendString(tManager.RemoteProfiles.First,'Login',tLogin.Text);
tAProfile.SendString(tManager.RemoteProfiles.First,'Password',tPassword.Text);
end;
2. Project Code: I creat global var
private
{ Private declarations }
public
{ Public declarations }
end;
var
aLogin, aPassword:string;
implementation
{$R *.fmx}
Then I put put this code on TetherAppProfile=>OnResourceReceived :
procedure TfServerPage.tAProfileResourceReceived(const Sender: TObject;
const AResource: TRemoteResource);
begin
if AResource.Hint='Login' then
begin
aLogin:=AResource.Value.AsString;
end;
if AResource.Hint='Password' then
begin
aPassword:=AResource.Value.AsString;
end;
rQuery.Close;
rQuery.SQL.Clear;
rQuery.SQL.Add('select * from authoriation where name='+QuotedStr(aLogin)+'and password='+QuotedStr(aPassword));
rQuery.Open;
if rQuery.RecordCount=0 then // No record found for user
ShowMessage('Be sure user name and password is correct')
else
begin
ShowMessage('Success!');
end;