查看單個文章
  #1  
舊 2007-06-23, 12:22 AM
哈啦 的頭像
哈啦 哈啦 目前離線
論壇管理員
 
註冊日期: 2002-05-28
文章: 23,011
預設 請教亂碼的問題

我有一個文件,很奇怪,那個文件執行時,所有填上中文的都可以順利顯示,唯獨裡面一塊「內容簡介」裡填上中文,出來時卻成為亂碼?整個網站都已採utf-8編碼,不知為何會出這種狀況?

文件如下,紅色那塊出來的內容,填上中文會成為亂碼:
引用:
{include file="header.tpl"}
{literal}
<script>
function checkform()
{
if (document.video.titletext.value == '') {
alert('Please Enter A Title');
return false;
}
else if (document.video.descriptiontext.value == '')
{
alert('Please Enter A description');
return false;
}
else if (document.video.authortext.value == '')
{
alert('Please Enter A Author');
return false;
}
else if(!document.video.picture[0].checked && !document.video.picture[1].checked && !document.video.picture[2].checked) {
alert('Please Choose A Screenshot');
return false;
}
// If the script gets this far through all of your fields
// without problems, it's ok and you can submit the form

return true;
}</script>
{/literal}
<div align="center">
<form action="submit.php?pt=submit&amp;part=3" method="post" name="video" onSubmit="return checkform()">
<!--Center Page-->
<h3><b>Source</b>:{$source}
</h3>
<!--Source Of Media-->
<b>Confirm Default Screenshot</b>
<input name="videoid" type="hidden" value="{$videoid}" />
<input name="vidtype" type="hidden" value="{$vidtype}" />
<input name="file2" type="hidden" value="{$file2}" />

<table width="136" border="0">
<!--Shows All The Images-->
<tr> {section name=default loop=$image}
<td align="center" width="130"><img src="{$image[default]}" alt="{$title}" width="130" height="97" /> </td>
{/section} </tr>
<tr> {section name=default loop=$image}
<td align="center"><input name="picture" type="radio" value="{$image[default]}" checked="checked" />
</td>
{/section} </tr>
</table>
<!-- END - Shows All The Images-->
<table width="83" border="0">
<tr>
<td height="21" align="center"><b>Title</b></td>
</tr>
<tr>
<td height="21" align="center"><textarea name="titletext" cols="50" rows="1" id="titletext" style="text-align:center; text-shadow:#990000">{$title}</textarea></td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="77" height="21" align="center"><b>Author</b></td>
</tr>
<tr>
<td height="42"><textarea name="authortext" cols="50" rows="1" style="text-align:center;">{$author}</textarea> </td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="21" align="center"><b>內容簡介</b></td>
</tr>
<tr>
<td height="104"><textarea name="descriptiontext" cols="50" rows="6" style="text-align:center;">{$description}</textarea> </td>
<td>&nbsp;</td>

</tr>
<tr>
<td height="19" align="center"><b>Category</b></td>
</tr>
<tr>
<td height="104" align="center"><select name="category" size="6">


{section name=cat loop=$cat}
<option value="{$cat[cat].id}" {if $cat[cat].id eq "1"}selected="selected"{/if}>{$cat[cat].name}</option>
{/section}



</select> </td>
<td>&nbsp;</td>
</tr>
</table>
<p align="center">{include file="players.tpl"} </p>
<p align="center">
<input type="submit" value="Submit">
</p>
</form>
</div>
{include file="footer.tpl"}
__________________
咖啡走路
微博


您是網站站長嗎?歡迎到站長俱樂部 一起討論吧。
按我看版規
code.club
回覆時引用此篇文章