再开一帖,还是关于htm输出php的问题
原帖:http://topic.gaodaima.com/u/20120516/14/14e8916b-59cf-49d7-8dc0-0e9112b67b66.html?seed=440870802&r=78580743#r_78580743
最新情况是这样的:程序为phpmps,模版文件是.htm,我现在在模版文件中的代码是:
- HTML code
<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?phpif(empty($swt_c)){ echo "";}else{ echo "<script type=\"text/javascript\" src=\"{$swt_c}\"></script>";}?>
但是输入到html的前台源代码是这样的:
- HTML code
<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><script type="text/javascript" src="<?php echo http://xxx.xxx.com/xxx/swt.js;?>"></script>
也就是说把<?php echo和?>都显示了,另外:{$swt_c}的内容是以h本文来源[email protected]搞@^&代*@码)网9搞代gaodaima码ttp://开通的链接代码,求解决过程!
——解决方案——————–
模板文件里这写
{if !empty($swt_c)}
<script type=”text/javascript” src=”{$swt_c}”></script>
{/if}