hello everyone !!
I'm trying to make a game of answers and questions, using php and OkHttpUtils2, but I have a problem with the requests ( Job.Download and Job.PostString )
B4X code :
output B4X:
repeat 3x number 1 , and 2x number 2 initially ...
PHP source :
Have a way to fix it ?
I'm trying to make a game of answers and questions, using php and OkHttpUtils2, but I have a problem with the requests ( Job.Download and Job.PostString )
B4X code :
B4X:
'Static code module
Sub Process_Globals
Private fx As JFX
Private GameTimer As Timer
End Sub
Sub EnterGame
GameTimer.Initialize("GameTimer", 500)
GameTimer.Enabled = True
End Sub
Sub GameTimer_Tick
Dim j As HttpJob
j.Initialize("", Me)
'j.Download("http://localhost/getviews.php")
j.PostString("http://localhost/getviews.php","")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log(j.GetString)
End If
j.Release
End Sub
output B4X:
B4X:
Waiting for debugger to connect...
Program started.
views = 1
views = 1
views = 1
views = 2
views = 2
views = 3
views = 4
views = 5
views = 6
views = 7
views = 8
views = 9
views = 10
views = 11
views = 12
views = 13
views = 14
views = 15
views = 16
meucu1
views = 17
views = 18
views = 19
helloworld
views = 20
views = 21
views = 22
views = 23
views = 24
views = 25
views = 26
repeat 3x number 1 , and 2x number 2 initially ...
PHP source :
PHP:
<?php
session_start();
if(isset($_SESSION['views']))
$_SESSION['views'] = $_SESSION['views']+1;
else
$_SESSION['views']=1;
echo"views = ".$_SESSION['views'];
?>
Have a way to fix it ?