answersLogoWhite

0

If you want to save a variable to be used in the same script at different executions by the same user, you should try using sessions. Start a session (session_start()) and retrieve the variable in question (for example, $_SESSION['var']). Throughout the script, edit the variable ($_SESSION['var']) and it will automatically be saved for the next execution by the same user.

Alternatively, if you want the value of the variable to be accessed by all users (and allow all users to edit the variable), do as stated above, but before starting the session, define a session name with the session_name() function. All users will refer to the session defined in the session name, thus using the same variable despite the user.

See the related links for further help using sessions.

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Basic Math

What is a difference between passing by value and passing arguments by reference in visual basic 6 procedures?

When we pass arguments my value, we are passing the value represented in the variable mentioned in the call, and not the variable itself. Therefore, any modifications made to that value will NOT be reflected in the variable mentioned in the call. Pass by reference, as the name suggests passes the reference of the variable mentioned in the procedure call. Any modifications made to the data of that variable is changed at the memory location of that data itself, and will be reflected in the variable itself, after the procedures completes.


What is a logical variable in PHP?

Maybe your speaking a variable that contains a ternary operators such as:


What is the input of a variable called in qbasic?

Variables don't have inputs. A variable is a named memory location where a value may be read or written. You write a variable by assigning a value to it. The value may be obtained from user-input.


Is 3w-7 an open sentence?

Yes, the expression (3w - 7) is considered an open sentence because it contains a variable ((w)) and does not have a specific value assigned to it. Open sentences can take on different values depending on the value of the variable. In contrast, a closed sentence would have a specific value or statement, such as (3w - 7 = 0).


Explain how to find restrictions on the variable in a rational equation?

Substitute the variable in the denominator for a value that will make the denominator have a value of 0 or an imaginary number

Related Questions

Why use awk -v command?

This is used when you want to give a variable in an awk script a value before the script starts executing, even before the BEGIN block. You would do this on the command line if the variable needs different values for different executions rather than hardcoding it in the awk script itself.


What is a continous variable?

a variable that can take on many different values, in theory, any value between the lowest and highest points on the measurement scale.


What is the difference between an array shift and unsetting a variable in PHP?

By shifting the values in an array, you are moving a key's value to the previous key. The very first key's value is obliterated. By shifting all values in the array, all keys will have a value of NULL. Unsetting a variable is entirely different -- performing a variable unsetting causes the variable to have a value of NULL, as if it was never set.


What is the value of a variable?

A variable can have lots of different values - as opposed to a constant which has only one. That is why it is called a variable!


What is the difference between a variable and a literal in prgramming?

a literal is a constant value, the difference is a variable can change it's value.


How is solving for a specified variable in a formula different to finding a solution for an equation or inequality?

With a formula, you know the variable's value, and you have to calculate the value of the function of it. With an equation, you know the function's value, and you have to calculate the value of the variable.


What happens to the value of a local variable when the module in which the variable is declared completes execution and control is passed to a different module?

The local variable goes away and the value is lost.


What is a continuous independent variable?

A variable is something that can take different values. These values may be qualitative (colour, gender, favourite singer etc) or quantitative. A continuous variable must be quantitative such that it can take all values between its lowest (minimum) and highest (maximum). The variable is independentif its value is not affected by the value of any other variable under consideration.


What is difference between variable and constant?

Whether or not you can change its value.


How you can modify an integer variable value in a function?

with an assignment: variable = value variable += value variable /= -3; ...


Difference between nominal and real variable?

A nominal variable is a variable measured in current dollars (the value of the dollar for the specific period discussed), and a real variable is a variable measured in constant dollars (the value of the dollar for the base period). That is, a real variable adjusts for the effects of inflation.


What is the probability the random variable will assume a value between 40 and 60?

It depends on what the random variable is, what its domain is, what its probability distribution function is. The probability that a randomly selected random variable has a value between 40 and 60 is probably quite close to zero.