Today from csdn
Http://topic.csdn.net/u/20090715/17/8b549255-0767-4b16-b9d7-8588ffcdeb2d.html? 64203
The program in the message book always reports the following errors when running the smarty program:
Fatal error: smarty error: [In a.htm line 1]: syntax error: Invalid attribute name: '113_01.htm/'(smarty_compiler.class.php, line 1550) in D: /appserv/www/smarty/libs/smarty. class. PHP on line 1092
At the beginning, I thought it was the reason for the colon, but it was not correct.
Then I searched the internet and found the explanation of the error. Now let me explain the incorrect translation. It is inevitable that the English is not very good.
Smarty error: [In File: XX. TPL line 1]: syntax error: Invalid attribute name: 'index. TPL/'(smarty_compiler.class.php, line 1521)
// When you encounter this error, it means that your magic_quotes_runtime setting is open in your php. ini configuration file.
// Smarty can run only when the value is disabled.
// Do not confuse magic_quotes_runtime with the value of magic_quotes_gpc (The implication is that the two settings are different). Smarty only needs to disable magic_quotes_runtime.
If you encounter an error like this, then you have magic_quotes_runtime
Turned on in you PHP. ini. Smarty needs this value to be turned off to operate properly.
Don't mix magic_quotes_runtime
Up with magic_quotes_gpc
.
Smarty only needs the former to be off.
// If you cannot change PHP. ini in your web configuration, you can use ini_set ('Magic _ quotes_runtime', false); disable it when the program is running
If you don't have access to your php. ini or to your webserver-configuration, then you can turn magic_quotes_runtime off at runtime
[PHP: 1: b7ea9ca818] ini_set ('Magic _ quotes_runtime', false); [/PHP: 1: b7ea9ca818]
// But it is best to disable it in the configuration file.
But it's best to simply bother your system-administrator to turn it off globally.
I disable it in this way.
If (get_magic_quotes_runtime ())
{
Set_magic_quotes_runtime (0 );
}
This configuration is disabled in some versions. For example, the PHP runtime environment of my computer at home is disabled by default, so when I use the include function in smarty, no error will be reported. Get_magic_quotes_runtime is set to 1; otherwise, it is set to 0.
This statement is used to determine whether to enable the statement. If yes, It is disabled.Ini_set ('Magic _ quotes_runtime ', false); this statement can be stored in the smarty configuration file using the above method.
It is automatically determined at each import.
Because there are still some open functions.