Android Question Need server side code when "PostString" is used in B4a

Pravee7094

Active Member
Hi all,
Successfully tested "CreateCommand" in B4a and corresponding thing in B4j. Working fine.
B4X:
Dim cmd As DBCommand = CreateCommand("get_data", Array(cell))

Now I want to use "PostString" instead of "CreateCommand" in B4a. Got sample coding in B4a, Need sample coding to receive "PostString" command and return json string from B4j.

Anybody Help!

Regards
Praveen
 

Num3

Active Member
Licensed User
Longtime User
Hi,
This is how i use poststring:
B4X:
    Request = $"id=${someid}&variable1=${somevariable1}"$
    j.PostString("yoururl/mypage.php", Request)

On the php page:
B4X:
<?php

    $_id = isset( $_POST["id"] ) ? $_POST["id"] : null; // Check if id POST is set
    $_var1 = isset( $_POST["variable1"] ) ? $_POST["variable1"] : null; // Check if variable1 POST is set

    If (isset($_id))
    {
        //$id is set! 
        //Do something here
        echo $_var1;
        
    }else{
        
        header("HTTP/1.0 400 Bad Request");
        //exit('Not found');
    }   
?>
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Now I want to use "PostString" instead of "CreateCommand" in B4a. Got sample coding in B4a, Need sample coding to receive "PostString" command and return json string from B4j.
I don't understand anything from your question. You can see jRDC2 client and server code to better understand how they are implemented.
 
Upvote 0
Top