Code submitted to SoloLearn runs approximately 10s, once. There is no official saved state: You get 1 run, 1 output, and then everything this server knows about you app vanishes...so no form POSTing (no URL to use in any case).
You could:
1. Submit separate code simulating a POST processor (same app + different input modes or separate apps)
2. Get a CodeAnywhere, AWS or Heroku box
3. Set up your own server (easier?: search for WAMP/LAMP premade virtual machines or dockers)
4. Try various Android apps (Termux, Android Servers Ultimate, PHP Server, ...)
Otherwise the best approaches I've seen to interactivity include:
1.
Python: Embedded steps (Ahri Fox): feeding the next choices to users as subsequent inputs for each run. You'd have to write your PHP this way (mode 1, mode 2, ...)
2. Web: Offloaded state (like Burey's games/apps).
3. I have ideas, but I'm being careful. I'll post if something's good.
By the way: you can 'return false;' as part of onsubmit() to cancel the actual POST (stay in the app) while still processing code:
onsubmit="doStuff(); return false;"