Smarty 使用伪静态的时候,传递参数的时候页面为什么会乱? 我在传递参数的时候如 ID_1.HTML 页面内容会显示出来!但是页面会乱掉!但是我修改为ID=1的时候页面就会正常显示1想问下怎么解决好呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function ParseUrl(){ if($_SERVER['PATH_INFO']!=""){ $pathinfo=substr($_SERVER['PATH_INFO'],1); $pathinfo=str_replace(".htm","",$pathinfo); $path=explode("_",$pathinfo); $count=count($path); for($i=0;$i<$count;$i+=2){ $_GET[$path[$i]]=$path[$i+1]; } } } ParseUrl();$id = $_GET['id'];$sql="select * from xmnews where id=$id";$query=$db->query($sql);$rs=$db->fetch_array($query);$n=array("title"=>"$rs[title]","content"=>"$rs[content]");$smarty->assign("n",$n);$smarty->display("lxsinge.html",$id);{include file="sheader.html" }<div style="width:960px; margin:10px auto;">{include file="slefter.html" } <div style="width:725px; float:right;"> <div style="width:725px; height:28px; background:url(images/tit.jpg);"> <div style="padding:8px 0px 0px 18px; font-size:14px; font-weight:bold; color:#0C6190;"></div> </div> <div style="width:683px; min-height:400px; border-left:1px #E3EEF2 solid; border-right:1px #E3EEF2 solid; border-bottom:1px #E3EEF2 solid; padding:20px; line-height:175%; overflow-x:hidden;"> <div style="width:600px; margin:10px auto 20px auto; padding-bottom:10px; font-size:20px; color:#000000; font-family:黑体; text-align:center; border-bottom:1px #dddddd solid;">{$n.title}</div> {$n.content} </div> </div> <div style="clear:both;"></div> </div>{include file="footer.html" } $i = 1;$loops = array();while($rs = $db->fetch_array($query)) { $crs = array(); $crs['i'] = $i++; $crs['id'] = $rs['id']; $crs['title'] = $rs['title']; $crs['date'] =$rs['date']; $loops[] = $crs;}$db->free_result($query);$pagelist = $page->getpagelist();foreach($loops as $news) {$path="http://127.0.0.1/test2/singe.php/";$path.= MakeUrl(array('id'=>$news[id]));$arr2[]=array("ym"=>"$path","title"=>"$news[title]","date"=>"$news[date]");}//$arr=array("测试","内容");$smarty->assign("bb",$arr);$smarty->assign("c",$arr2);$smarty->assign("pagelist",$pagelist);$smarty->display("index.html",$pageno);//$smarty->clear_cache("index.html"); xajax官方的例子不载入php函数 急:高手快进 求PHP入门的书籍,本人刚学,一点都不会 PHP调用外部程序的问题 上传文件问题 在本地测试可以 在服务器就不能了 求助:PHP函数嵌套传值的简单问题 ***绝对难题: target: 能target 变量$_SESSION["page"] 到框架吗? *** 关于输出整型 关于smarty模板不能显示出来的问题 怎样只刷新显示的数据,网页中别的地方不刷新? php网站设计 Apache通过rewrite绑定二级域名的问题
if($_SERVER['PATH_INFO']!=""){
$pathinfo=substr($_SERVER['PATH_INFO'],1);
$pathinfo=str_replace(".htm","",$pathinfo);
$path=explode("_",$pathinfo);
$count=count($path);
for($i=0;$i<$count;$i+=2){
$_GET[$path[$i]]=$path[$i+1];
}
}
}
ParseUrl();
$id = $_GET['id'];
$sql="select * from xmnews where id=$id";
$query=$db->query($sql);
$rs=$db->fetch_array($query);$n=array("title"=>"$rs[title]","content"=>"$rs[content]");
$smarty->assign("n",$n);
$smarty->display("lxsinge.html",$id);
{include file="sheader.html" }
<div style="width:960px; margin:10px auto;">
{include file="slefter.html" }
<div style="width:725px; float:right;">
<div style="width:725px; height:28px; background:url(images/tit.jpg);">
<div style="padding:8px 0px 0px 18px; font-size:14px; font-weight:bold; color:#0C6190;"></div>
</div>
<div style="width:683px; min-height:400px; border-left:1px #E3EEF2 solid; border-right:1px #E3EEF2 solid; border-bottom:1px #E3EEF2 solid; padding:20px; line-height:175%; overflow-x:hidden;"> <div style="width:600px; margin:10px auto 20px auto; padding-bottom:10px; font-size:20px; color:#000000; font-family:黑体; text-align:center; border-bottom:1px #dddddd solid;">{$n.title}</div>
{$n.content}
</div>
</div>
<div style="clear:both;"></div>
</div>
{include file="footer.html" }
$loops = array();
while($rs = $db->fetch_array($query)) {
$crs = array();
$crs['i'] = $i++;
$crs['id'] = $rs['id'];
$crs['title'] = $rs['title'];
$crs['date'] =$rs['date'];
$loops[] = $crs;
}
$db->free_result($query);$pagelist = $page->getpagelist();foreach($loops as $news) {
$path="http://127.0.0.1/test2/singe.php/";
$path.= MakeUrl(array('id'=>$news[id]));
$arr2[]=array("ym"=>"$path","title"=>"$news[title]","date"=>"$news[date]");
}//$arr=array("测试","内容");
$smarty->assign("bb",$arr);
$smarty->assign("c",$arr2);
$smarty->assign("pagelist",$pagelist);
$smarty->display("index.html",$pageno);
//$smarty->clear_cache("index.html");