[請益] 也是網頁亂碼的問題
請問版上各位高手
我在php檔中有寫 中文字
可是用網頁開就會碰到 中文變成亂碼的問題
出問題的程式碼部份如下
<tr>
<td>問題如下</td>
<td><input type="text" name="question" size="50"></td>
</tr>
網址:http://140.123.175.240/DO/video_polls/addpoll_web.php
出現的問題就是裡面的 ????‧原本應該是"問題如下"四個字,英文部份沒問題
因為我有連結資料庫,那部份是沒有問題的
我也有加上這三行
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER_SET_CLIENT=utf8;");
mysql_query("SET CHARACTER_SET_RESULTS=utf8;");
請問可以有告訴我該怎麼改嗎? 一直出現亂碼很困擾
感謝!!
---------------------------------------------------
另外附上完整程式碼‧如果有人願意看就太感動了
---------------------------------------------------
<html>
<head>
<title>Add User Poll</title>
</head>
<body>
<font size="+2"><b>Add User Poll</b></font><br><br>
<?
// addpoll.php
// If the form has been submitted...
include('common.php');
// Connect to database
$link = dbConnect();
mysql_query("SET NAMES 'utf-8'");
mysql_query("SET CHARACTER_SET_CLIENT=utf-8;");
mysql_query("SET CHARACTER_SET_RESULTS=utf-8;");
// Get date for new poll
//$posted = time();
$posted = strftime("%A %d/%m/%y", $poll['posted']);
print "&posted=" . urlencode($posted);
// Build query to insert new poll
$query = "INSERT INTO polls (question, option1, option2, option3, posted)
VALUES('$question', '$option1', '$option2', '$option3',
$posted)";
// Execute query
$result = @mysql_query($query);
// If query failed...
if (!$result) {
// Display error
print "<font color=\"#ff0000\">Could not insert poll</font><br>\n";
} else {
print "<font color=\"#0000ff\">Poll added</font><br>\n";
}
mysql_close($link);
?>
</form>
</body>
</html>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.175.240
※ 編輯: divaka 來自: 140.123.175.240 (08/15 16:27)
※ 編輯: divaka 來自: 140.123.175.240 (08/15 16:28)
※ 編輯: divaka 來自: 140.123.175.240 (08/15 16:28)
推
08/15 16:28, , 1F
08/15 16:28, 1F
推
08/15 16:31, , 2F
08/15 16:31, 2F
→
08/15 16:31, , 3F
08/15 16:31, 3F
討論串 (同標題文章)