Hello everyone
I try to explain better the problem
On my server, I have two databases, the first is to vbulletin where you placed the forum and the other database that uses my application. I used the PHP file to Erel, which interface beautifully the Android application with the database created by me. At this point I would like the application to be used exclusively by our members forum, so I thought to make an initial login through another php file type "login.php" going to charge the users table fields username and field password vbulletin that clearly is encoded in md5.
Looking around a bit came off the library "Encryption", but to tests performed, using my account, I noticed that the password stored in the table vbulletin has a coding completely different from the one that comes out with
Dim txt as Byte
txt = "password test" .GetBytes ("UTF8")
txt = md.GetMessageDigest (txt, "MD5")
I went to watch a bit of the file login.php vbulletin and from what I could understand (php not understand anything, or God is not who understands much about this but I try to make do) and it seems that using the php function convert .md5 to convert the incoming password in md5 format and then compare with the one stored on the database.
What I wonder, if the format is different, if there is a pious soul to help me write a function in php that returns the number of the user's post if the conditions are met username and password, or "password and / or username is wrong. "
If this condition is met put in my database in the user table the device ID. Naturally, this information would be made before requesting id and password control, because if the device is to say that is logged.
Using this code for the device to be stored change file.exist with e db query
I try to explain better the problem
On my server, I have two databases, the first is to vbulletin where you placed the forum and the other database that uses my application. I used the PHP file to Erel, which interface beautifully the Android application with the database created by me. At this point I would like the application to be used exclusively by our members forum, so I thought to make an initial login through another php file type "login.php" going to charge the users table fields username and field password vbulletin that clearly is encoded in md5.
Looking around a bit came off the library "Encryption", but to tests performed, using my account, I noticed that the password stored in the table vbulletin has a coding completely different from the one that comes out with
Dim txt as Byte
txt = "password test" .GetBytes ("UTF8")
txt = md.GetMessageDigest (txt, "MD5")
I went to watch a bit of the file login.php vbulletin and from what I could understand (php not understand anything, or God is not who understands much about this but I try to make do) and it seems that using the php function convert .md5 to convert the incoming password in md5 format and then compare with the one stored on the database.
What I wonder, if the format is different, if there is a pious soul to help me write a function in php that returns the number of the user's post if the conditions are met username and password, or "password and / or username is wrong. "
If this condition is met put in my database in the user table the device ID. Naturally, this information would be made before requesting id and password control, because if the device is to say that is logged.
Using this code for the device to be stored change file.exist with e db query
B4X:
Sub GetDeviceId As String
Dim r As Reflector
Dim Api As Int
Api = r.GetStaticField("android.os.Build$VERSION", "SDK_INT")
If Api < 9 Then
'Old device
If File.Exists(File.DirInternal, "__id") Then
Return File.ReadString(File.DirInternal, "__id")
Else
Dim id As Int
id = Rnd(0x10000000, 0x7FFFFFFF)
File.WriteString(File.DirInternal, "__id", id)
Return id
End If
Else
'New device
Return r.GetStaticField("android.os.Build", "SERIAL")
End If
End Sub