Increment variable and save server side in .php script -
this pretty long question in words, adds 1 function.
for time, have tried figuring out how increment variable, save , display it. problem figured out save variable , allow users on website see same updated variable, has saved server side, have big question have tried figure out 1 thing, , has way.
to store variable server side, enough save variable in .php script because if so, think looking way have variable in .php script, when specific function called want increment variable one, , last want save variable server side, able have exact same variable on users screens. .php script called form html script, there no problem there, problem mentioned above, how make variable in .php script, increment variable when function called, save variable , pass html page display.
at first 1 may think of session variable, pointed out should shared among users, need save database, file or use cache server.
are using database? can create single table containing key , value columns. keep row specified key up-to-date variable value want keep track of.
if don't have access database server, can serialize variable or store text file , read it. problem here concurrency, if have many users @ same time, won't able update @ once.
cache server bit more complicated explain, further documentation that. luck!
Comments
Post a Comment