急——求一常见问题的解决方法!!!!!

hua_zhixing_ 2010-11-22 04:06:11
环境:php + apache + mysql
主页可以打开,但部分网页打不开,打开相关网页时,显示的是部分源代码。如下:
1。浏览器中显示的是:
select_assoc("select * from {$pre}moban_cate"); $smarty->assign("lei",$l); $lei=array(); foreach($l as $v ) { $lei[$v['id']]=$v['title']; } /*调模板信息*/ $type=$_GET['type'];
2。 select_assoc函数定义是:
function select_assoc($sql){
if( $sql == "" ){
return false;
}

$result=@mysql_unbuffered_query ($sql,$this->link_id) or $this->ErrorMsg($sql);
$i=0;
while($row=@mysql_fetch_assoc($result)) {
$i++;
$result_array[$i]=$row;
}
return ($i > 0)?$result_array:false;
}

3。select_assoc函数调用是:
<?
require_once ("top.php");
require_once ("foot.php");
require_once(ROOT."/config/page.class.php");
//////*模板分类*/
$l=$mydb->select_assoc("select * from {$pre}moban_cate");
$smarty->assign("lei",$l);


这里都是部分代码。请问造成这种情况是什么原因,怎么解决?????
...全文
87 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hua_zhixing_ 2010-11-24
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 luciferstar 的回复:]

刚才看了下,是short_open_tag

; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are……
[/Quote]
这么神奇!问题解决啦!
君望永远 2010-11-23
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 luciferstar 的回复:]

short_tag
你的PHP.INI中没有开启short_tag。所以只支持<?php ?>不支持<? ?>
开启后重启apache即可。
[/Quote]正解~
hua_zhixing_ 2010-11-23
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 luciferstar 的回复:]

short_tag
你的PHP.INI中没有开启short_tag。所以只支持<?php ?>不支持<? ?>
开启后重启apache即可。
[/Quote]
不像这么简单吧?我试试。
LuciferStar 2010-11-22
  • 打赏
  • 举报
回复
刚才看了下,是short_open_tag

; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On
LuciferStar 2010-11-22
  • 打赏
  • 举报
回复
short_tag
你的PHP.INI中没有开启short_tag。所以只支持<?php ?>不支持<? ?>
开启后重启apache即可。

4,250

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧