In the case of a set of applications, it is sometimes necessary to use global variables, such as: After the successful login to save the user name, and then in each page can be used (for example, using the user name to the user can see the data filtered). At this point, you need to use global variables.
The global variables of the scriptcase are marked as: [VarName].
For example, at the time of login, the user name can be saved to [Usr_login] after verification pass, so long as it can be used in the application inside the system, whether it is in the code or in the configuration function.
On a list, we may want to display only the current user's data, and its SQL statement can be configured as:
SELECT filename1, fieldname2 from table1 WHERE login= ' [Usr_login] '
The system reads the global variable and prompts the user to log back in if the login fails.
If you define a variable that is used in the current function, you can use the $varname directly.
For a field, you can use {fieldname} to access it. For example, we want to encrypt the user-set password with MD5 and save it to the database, which can be written in this form:
{Password} = MD5 ({password});
Curly braces There is also an application of a multi-lingual translation, as long as the definition of language tags, can be used directly in the code, such as:
{ErrorMessage} = {Lang_message_inserterror};
You can set the characters for different languages in the language Settings-regional language so that the system can support multiple languages.
http://www.bkjia.com/PHPjc/477431.html www.bkjia.com true http://www.bkjia.com/PHPjc/477431.html techarticle when doing a set of applications, it is sometimes necessary to use global variables, such as: After the successful login to save the user name, and then in each page can be used (for example, the use of ...