
请教关于PHP 中文参数传递的问题
各位师傅好,请教下关于PHP中中文传递的问题。PHP部分<?phprequire'include/common.inc.php';includetpl("city");?...
各位师傅好,请教下关于PHP中中文传递的问题。
PHP 部分
<?phprequire 'include/common.inc.php';
include tpl("city");?>
获取页面模板
{:tpl header}
<div class="content_main">
<div class="content_left">
<div class="posation"><span style="float:right">当前所在位置:<a href="{:$set_url}">首页</a>>><!--{:loop $gpos $v}--><a href="{:$v['url']}">{:$v['name']}>></a><!--{:/loop}--></span><h1>{:$gcategory[$catid][name]}</h1></div>
<div class="list_content" id="listcontent">
<div class="list_content">
<ul>
{:get sql="SELECT * FROM ybyjls_album where defaultpicurl!='' AND `catid`=27 and city=$city and recycle=0 ORDER BY id DESC",rows="4"}
<table width="730" border="0" align="center" cellpadding="0" cellspacing="5" style="margin-bottom:10px; border:1px solid #ccc">
<tr>
<td width="98" rowspan="2" valign="top"><a href="{:$r['url']}" title="{:$r['title']}" ><img src="{:$r['defaultpicurl']}" alt="{:$r['title']}" width="80" height="60" /></a></td>
<td width="617" valign="top"><strong><a href="{:$r['url']}" title="{:$r['title']}"><span {:$r[color]}>{:tag_cut($r['title'],24,1)}</span></a></strong></td>
</tr>
<tr>
<td valign="top"><a href="{:$r['url']}" title="{:$r['title']}">{:tag_cut($r['description'],120,1)}</a></td>
</tr>
</table>
{:/get}
</ul>
<!--分页-->
<div class="feny">das</div>
<div style="clear:both"></div>
<!--end-->
</div>
</div>
<div style="clear:both"> </div>
</div>
<!--end main-->
<div class="content_right">{:tpl side}</div>
<div style="clear:both"> </div>
</div>
{:tpl footer}
希望各位老师能帮忙,谢谢,该页面获取的是 catid和 city 城市,其中城市无法获取 展开
PHP 部分
<?phprequire 'include/common.inc.php';
include tpl("city");?>
获取页面模板
{:tpl header}
<div class="content_main">
<div class="content_left">
<div class="posation"><span style="float:right">当前所在位置:<a href="{:$set_url}">首页</a>>><!--{:loop $gpos $v}--><a href="{:$v['url']}">{:$v['name']}>></a><!--{:/loop}--></span><h1>{:$gcategory[$catid][name]}</h1></div>
<div class="list_content" id="listcontent">
<div class="list_content">
<ul>
{:get sql="SELECT * FROM ybyjls_album where defaultpicurl!='' AND `catid`=27 and city=$city and recycle=0 ORDER BY id DESC",rows="4"}
<table width="730" border="0" align="center" cellpadding="0" cellspacing="5" style="margin-bottom:10px; border:1px solid #ccc">
<tr>
<td width="98" rowspan="2" valign="top"><a href="{:$r['url']}" title="{:$r['title']}" ><img src="{:$r['defaultpicurl']}" alt="{:$r['title']}" width="80" height="60" /></a></td>
<td width="617" valign="top"><strong><a href="{:$r['url']}" title="{:$r['title']}"><span {:$r[color]}>{:tag_cut($r['title'],24,1)}</span></a></strong></td>
</tr>
<tr>
<td valign="top"><a href="{:$r['url']}" title="{:$r['title']}">{:tag_cut($r['description'],120,1)}</a></td>
</tr>
</table>
{:/get}
</ul>
<!--分页-->
<div class="feny">das</div>
<div style="clear:both"></div>
<!--end-->
</div>
</div>
<div style="clear:both"> </div>
</div>
<!--end main-->
<div class="content_right">{:tpl side}</div>
<div style="clear:both"> </div>
</div>
{:tpl footer}
希望各位老师能帮忙,谢谢,该页面获取的是 catid和 city 城市,其中城市无法获取 展开
3个回答
展开全部
中文传递在php的POST 传递中比较ok 因为是底层帮你转码了。主要问题出现在GET 方式传递中文。需要手动转一下编码 $中文 = iconv("gb2312","UTF-8",$中文);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询