Home >Backend Development >PHP Tutorial > 再开一帖,还是关于htm输出php的有关问题

再开一帖,还是关于htm输出php的有关问题

WBOY
WBOYOriginal
2016-06-13 13:31:20764browse

再开一帖,还是关于htm输出php的问题
原帖:http://topic.csdn.net/u/20120516/14/14e8916b-59cf-49d7-8dc0-0e9112b67b66.html?seed=440870802&r=78580743#r_78580743
最新情况是这样的:程序为phpmps,模版文件是.htm,我现在在模版文件中的代码是:

HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><?php if(empty($swt_c)){
  echo "";
}else{
  echo "<script type=\"text/javascript\" src=\"{$swt_c}\">";
}
?>

但是输入到html的前台源代码是这样的:
HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><script type="text/javascript" src="<?php%20echo%20http://xxx.xxx.com/xxx/swt.js;?>"></script>

也就是说把都显示了,另外:{$swt_c}的内容是以http://开通的链接代码,求解决过程!

------解决方案--------------------
模板文件里这写
{if !empty($swt_c)}

{/if}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn