Android Question Append a line content to a Remote File with php

trepdas

Active Member
Licensed User
Hello again good people,

is there a way to add a new line into a remote txt file with b4x ? (yes)


I could download it, add my text and upload it with ftp (with writing rules).

Is there a better/smarter way?

🙏
 

trepdas

Active Member
Licensed User
With a shared hosting you will need to do it with PHP

Yes I was expecting that answer , unfortunately.

I also assume that I can't use JRDC2 either to connect to my remote sql server because of that.

so if I want to handle sql queries I'll have to use JdbcSQL.
correct?


THx
🙏
 
Upvote 0

trepdas

Active Member
Licensed User
ok. So I created a php file that looks like this :

B4X:
<?php
$fp = fopen('data.txt', 'a');
fwrite($fp, ' this is text was added by a user app ');
fclose($fp);

and now I need to call it from the b4x app. in which method should I use to call it?
Webview?
httpjob?

a sample example will be very much appreciated
🤔
 
Last edited:
Upvote 0

trepdas

Active Member
Licensed User
I have no problems with the php. it works and functioning. I'll try to call it with okhttputils2 with something like :


B4X:
 job2.Initialize("Job", Me)

  job2.PostString("http://www.mydomain/mypage.php", "key1=value1")

this should execute the php page I hope
 
Upvote 0
Top