Php high-score solving function: defines a global $ aaa variable on the phpA page. you need to use the value of the variable $ aaa on the phpB page. how can this problem be solved. ------ Solution -------------------- BincludeA... is that acceptable? Or can I renew the value? Or a cookie? Session? ------ Solution ------------------ php high score solution
Function: define A global $ aaa variable on the php A page. you need to use the value of the variable $ aaa on the php B page. how can this problem be solved.
------ Solution --------------------
B include A... is that acceptable? Or can I renew the value? Or a cookie? Session?
------ Solution --------------------
Let's look at the writing method. for example, there are two.
The page only needs to be require or include.
------ Solution --------------------
There are no other methods except session, cookie, get, and post ..
------ Solution --------------------
Session/cookies
------ Solution --------------------
Discussion
There are no other methods except session, cookie, get, and post ..
------ Solution --------------------
Variable scope,
Any variables other than classes and functions are $ GLOBAL variables!
There are also system super global variables. $ _ GET, $ _ POST, and so on. It has a global scope!
------ Solution --------------------
You must use cookies or sessions to implement this.
------ Solution --------------------
Include or require.
------ Solution --------------------
Session cookie global variables
Give me some points. thank you.