Variable Application as ASP but for PHP? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Variable Application as ASP but for PHP?

Variable Application as ASP but for PHP? Translated by Google: Hi. If you used ASP Classic you may know that there are a couple of global variables, such as Session and Application ... Now, in the course of PHP that is here in SL there is the lesson with the variable Session. Now, how can I implement a SuperGlobal variable that I can access from all PHP pages and their values are not deleted when the user session ends, but the server session. I mean a Session variable that works only for the server and not for the client (as is the Session). I can not find anything on the internet. 😨😵😭

23rd May 2018, 6:54 PM
Pablo Fac
Pablo Fac - avatar
2 Answers
+ 2
One possible solution may be to store the required Application Variable in a file somewhere, and read/write from it from all PHP pages. And delete/clear this file when server is stopped. Also, instead of files, database may be used. Not sure about the exact steps though.
28th May 2018, 6:58 AM
Jay Dadhania
Jay Dadhania - avatar
0
Hi Jay Dadhania I want to make a basic game. I am practicing with arrays and they have told me that, that I use a file but that it will be very slow, but if there is no other way I will implement it like this then.
28th May 2018, 1:21 PM
Pablo Fac
Pablo Fac - avatar