AriGharavi
Member
Hi, I have problem to send request with httputils2 library (also tried OkHttpUtils2)
my host php code :
my b4a application code :
Log :
<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("f66bcd66cb958a3d0bfad4cb33146f2c");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://www.ariteam.gigfa.com/TF.php?i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>
my host php code :
PHP:
<?php
function test() {
$conn = new mysqli ("localhost","un","pass", "db");
mysqli_select_db('Romance',$conn);
mysqli_set_charset('utf8');
$username=$_POST['username'];
$password=$_POST['password'];
if (!$conn)
{
echo "Error: Unable to connect to MySQL.";
echo "Debugging errno: " . mysqli_connect_errno();
echo "Debugging error: " . mysqli_connect_error();
}
else
{
$result = "INSERT INTO RomReg(`Username`, `Password`, `Coins`) VALUES '$username','$password',10)";
if(mysqli_query($result)){
echo "Done";
}
else
{
echo "Error";
echo $username;
echo $password;
}
}
}
echo test();
?>
my b4a application code :
B4X:
#Region Project Attributes
#ApplicationLabel: B4A_register
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private Button1 As Button
Private EditText1 As EditText
Private EditText2 As EditText
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
End Sub
Sub Button1_Click
Dim j As HttpJob
j.Initialize("", Me)
Dim send As String
send = "username="&EditText1.Text&"&password="&EditText2.Text
j.PostString("http://www.ariteam.gigfa.com/TF.php",send)
Wait For (j) Jobdone(j As HttpJob)
If j.Success = True Then
Log(j.GetString)
Else
//err
ToastMessageShow("خطا در برقراری اتصال" , False)
End If
j.Release
End Sub
Log :
<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("f66bcd66cb958a3d0bfad4cb33146f2c");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://www.ariteam.gigfa.com/TF.php?i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>