Creating a home screen "web app" for smart phone
| From: | mbox at s22 dot us | Date: | Fri, 24 Apr 2020 17:30:45 +0000 |
| Subject: | Creating a home screen "web app" for smart phone | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-327105@lists.php.net to get a copy of this message | ||
I’ve written a PHP script that is served from my host's server that I can access from my
computer and/or my phone in a browser. Everything works perfectly.
There is a feature on the iPhone (apparently there’s something similar on Android, too) where I
can add the script to the home screen so it functions like an app. Very nice. However, as soon as
I click a link to go to any other page of my script, the new page opens in Safari and I lose the
full screen goodness of the web app.
So I thought I should change the script from multiple pages to a single page, and just change the
content on the main page. However, I can’t figure out how to make that work. I've tried
creating a session and loading each “page” by changing a $_SESSION[‘page’] variable, but the
session variable doesn’t appear to be global, or I’m doing it wrong. I echo’d that var both
before the $content and again afterwards, and only the 2nd one changes - not the first one - so, of
course, the content doesn’t change.
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?
Thanks,
Frank