smarty学习--invalid attribute name错误处理
来源:互联网 发布:cs1.6弹道优化config 编辑:程序博客网 时间:2024/05/18 01:23
今天从csdn
http://topic.csdn.net/u/20090715/17/8b549255-0767-4b16-b9d7-8588ffcdeb2d.html?64203
下了个smarty做的,留言本的程序在运行时总是报如下的错误:
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
刚开始还以为是冒号的原因,后来怎么改都不对。
后来在网上搜了下,找到了这个错误的解释。现在我来解释下这段错误的翻译,英语不是很好翻译有误在所难免。
Smarty error: [in file:xx.tpl line 1]: syntax error: invalid attribute name: 'index.tpl/' (Smarty_Compiler.class.php, line 1521)
//当你遇到这个错误时,说明你的magic_quotes_runtime设置是打开的在你的php.ini配置文件.
//smarty需要在这个值是关闭的时候才能运行
//切勿将magic_quotes_runtime打开与magic_quotes_gpc的值相混淆(言外之意就是两个设置是不一样的)smarty只需要将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.
//假如你无法更改php.ini在你的web配置当中,你可以用ini_set('magic_quotes_runtime', false);在程序运行时将其关闭
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 with
[php:1:b7ea9ca818]ini_set('magic_quotes_runtime', false);[/php:1:b7ea9ca818]
//但最好是在配置文件中将其关闭。
But it's best to simply bother your system-administrator to turn it off globally.
我是通过这样来将其关闭的。
if(get_magic_quotes_runtime())
{
set_magic_quotes_runtime(0);
}
因为这个设置在有些版本的配置里面他是关闭的,就比如我在家里的那台电脑的php运行环境默认就是关闭的,所以我在smarty里使用include函数就不会报错。get_magic_quotes_runtime设置打开时为1否则为0
这条语句就是先判断下,是否打开,如果有的话就将其关闭,另外只要把ini_set('magic_quotes_runtime', false);这条语句或是用我上面的方法, 放在smarty的配置文件中就没问题了。
每次引入时自动判断了。
因为打开的作用还是有的。
- smarty学习--invalid attribute name错误处理
- 解决smarty的 invalid attribute name 问题
- Android Studio 错误attribute name has invalid character '?'.
- Attribute name invalid for tag property according to TLD异常错误
- Attribute name invalid for tag property according to TLD 异常
- Error:(54) Tag <uses-permission> attribute name has invalid character '-'.
- Error:Tag <uses-permission> attribute name has invalid character ' '.
- iOS CUICatalog: Invalid asset name supplied 错误
- "The value for the useBean class attribute is invalid" 错误。
- 异常处理:Page directive has invalid attribute: trimDirectiveWhitespaces
- Attribute name invalid for tag form according to TLD异常解决办法
- STRUTS开发问题?Attribute name invalid for tag form according to TLD
- Invalid attribute name: package non-numeric second argument to `wordlist' function: ''. Stop.
- Error:Tag <uses-permission> attribute name has invalid character '?'. Error:java.util.concurrent.Exe
- godaddy空间 域名删除错误 Invalid domain name
- ERROR 微信安卓报http 400 Bad Request -Invalid Header name错误
- CUICatalog: Invalid asset name supplied: (null) 日志处理
- Js处理Json的”invalid label”错误
- 写给kinsan的话
- 日记090723
- 新手入门 --常用数据库JDBC连接写法
- 100多个很有用的JavaScript函数以及基础写法大集合
- Outlook Express 错误完整代码表-网管专栏,邮件服务
- smarty学习--invalid attribute name错误处理
- 模拟实现msn登陆过程(MSNP15)
- dwr弹出Error对话框的解决方法
- 使用业余者系统制作网站步骤
- win2K下安装Ubuntn的部分问题
- 什么是BOSS系统
- Linux下的时间表示
- JNI demo
- 开发框架--Struts里过滤器的简单使用