[英]Can't use swedish characters
我無法在網站上的表單中使用瑞典語字符。 如果我使用ÅÄÖ,該網站只會顯示錯誤消息“所有字段都必須填寫”。
如果我只輸入oaa左右,那么它就可以在所有字段中使用,但是如果我在其中一個字段中使用ÅÄÖ,則會收到錯誤消息,要求所有字段都必須填寫。
這對我來說是個問題,因為我的網站上有瑞典的廣播電台,而我的列表者希望以瑞典語向我發送請求。
誰能幫我,或者我該如何解決?
<?php
// Include the required glob.php file
require_once( "../_inc/glob.php" );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>radiPanel: Review Our DJ</title>
<style type="text/css" media="screen">
body {
background: #ddeef6;
padding: 0;
margin: 0;
}
body, a, input, select, textarea {
font-family: Verdana, Tahoma, Arial;
font-size: 11px;
color: #333;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
form {
padding: 0;
margin: 0;
}
.wrapper {
background-color: #fcfcfc;
width: 350px;
margin: auto;
padding: 5px;
margin-top: 15px;
}
.title {
padding: 5px;
margin-bottom: 5px;
font-size: 14px;
font-weight: bold;
background-color: #eee;
color: #444;
}
.content {
padding: 5px;
}
.good, .bad {
padding: 5px;
margin-bottom: 5px;
}
.good strong, .bad strong {
font-size: 12px;
font-weight: bold;
}
.good {
background-color: #d9ffcf;
border-color: #ade5a3;
color: #1b801b;
}
.bad {
background-color: #ffcfcf;
border-color: #e5a3a3;
color: #801b1b;
}
input, select, textarea {
border: 1px #e0e0e0 solid;
border-bottom-width: 2px;
padding: 3px;
}
input {
width: 170px;
}
input.button {
width: auto;
cursor: pointer;
background: #eee;
}
select {
width: 176px;
}
textarea {
width: 288px;
}
label {
display: block;
padding: 3px;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="title">
Bedöm en DJ
</div>
<div class="content">
<?php
// Check if the form has been submitted
if( $_POST['submit'] ) {
// The form has been submitted
try {
// Right, we have their data, so we check it and clean it up
$habbo = $core->clean( $_POST['habbo'] );
$dj = $core->clean( $_POST['dj'] );
$review = $core->clean( $_POST['review'] );
$ip = $_SERVER['REMOTE_ADDR'];
$time = time();
// Check for blank fields
if ( !$habbo or !is_numeric( $dj) or !$review ) {
// They have a problem
throw new Exception( "Alla fält är nödvändiga!" );
}
else {
// Everything is fine, so now to add our cleaned data to the database!
$db->query( "INSERT INTO reviews VALUES (NULL, '{$habbo}', '{$dj}', '{$review}', '{$ip}', '{$time}');" );
echo "<div class=\"good\">";
echo "<strong>Klart!</strong>";
echo "<br />";
echo "Din bedömning har nu skickats in, tack så mycket!";
echo "</div>";
}
}
catch( Exception $e ) {
echo "<div class=\"bad\">";
echo "<strong>Error</strong>";
echo "<br />";
echo $e->getMessage();
echo "</div>";
}
}
?>
<p><strong>Känner du att du vill ge lite ris och ros till någon av våra DJ's?</strong> Använd formuläret nedanför och gör en bedömning på någon av våra DJ's!</p>
<form action="" method="post">
<label for="habbo">Ditt namn:</label>
<input type="text" name="habbo" id="habbo" maxlength="255" />
<br /><br />
<label for="dj">DJ:</label>
<select name="dj" id="dj">
<?php
$users = $db->query( "SELECT * FROM users" );
while( $array = $db->assoc( $users ) ) {
?>
<option value="<?php echo $array['id']; ?>">
DJ <?php echo $array['username']; ?>
</option>
<?php
}
?>
</select>
<br /><br />
<label for="review">Meddelande:</label>
<textarea name="review" id="review" rows="10"></textarea>
<br /><br />
<input class="button" type="submit" name="submit" value="Skicka" />
</form>
</div>
</div>
</body>
</html>
There you have some code..
嘗試將此行放在<html>
標記之后
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
或檢查文件編碼並將其放在上一行
您的文檔類型已過時,並且您已將語言設置為英語。 嘗試使用以下doctype,html和meta標記啟動HTML文件:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.