On Fri, Apr 24, 2020 at 10:30 am, mbox@xxxxxx wrote:
Is there a way to do what I’m trying to do? Or am I going about it the wrong way? How can I make this script work as a web app on my phone?
Keep in mind that your PHP script runs on each request. It's impossible to run the script multiple times without additional requests. Unless you're using Javascript/AJAX requests, that means navigating to a different page, which sounds like exactly what you're trying to avoid.
To accomplish what you're trying to do, you may benefit from learning a single-page frontend framework, such as Ember [1]. This will let you navigate the web app without actually changing pages. The frontend then makes AJAX requests to your PHP (or whatever backend language you choose) scripts to get data from the server.
[1] Ember: https://emberjs.com/