PHP: define own server variable -
i've found own superglobal variable in php? here says there no way somehow define/use "server variable" same different users/sessions. but since few years has passed may has changed? , such possible?
basically want run php script triggered user event, don't want run more e.g. once per 30mins. frst thought keep "server side var (that visibles sessions/clients)" , if user trigger event (e.g. open page) check if script been running last 30 mins open page, if no before opening page e.g. purge outdated/passed things.
yes understand can workaround mysql etc... why workaroud if php support need.
thank in advance!
a regular php variable cannot persisted beyond current execution of script. once script ends, variables gone. that's basic nature of php; in fact it's basic nature of computer programs, it's php typically terminated quickly. persist data beyond single script invocation, have several options store data:
- a database
- a file
- shared memory (though may purged @ time)
- a memory cache memcached (basically in-memory database server)
- run persistent php script , communicate via sockets (basically memcache)
- don't terminate script, write daemon
nothing of has changed recently.
Comments
Post a Comment