我有一个反馈表单,但是当它涉及变音符号(元音变异)时它是不稳定的.例如,有时它会将'ö'显示为'ö'(正确),但有时我会得到一些奇怪的东西,比如'Hร¼ttenkäse'而不是'Hüttenkäse'.
页面编码(在Dreamweaver中)设置为Unicode(UTF-8),在phpmailer中我也改变了它:
/**
* The character set of the message.
* @type string
*/
public $CharSet = 'UTF-8';
Run Code Online (Sandbox Code Playgroud)
我在send.php的开头尝试了以下内容:
header('charset=utf-8');
Run Code Online (Sandbox Code Playgroud)
但我收到了来自服务器的错误消息,虽然邮件已发送,但主题中没有正确的破坏声,所以这似乎不起作用.
send.php由此表单触发:
<form method="post" action="send.php">
Run Code Online (Sandbox Code Playgroud)
send.php看起来像这样:
<?php
require_once("includes/phpMailer/class.phpmailer.php");
require_once("includes/phpMailer/class.smtp.php");
require_once("includes/phpMailer/language/phpmailer.lang-de.php");
$dl = $_GET['dienstleistung'];
$vorn = $_POST['vorname']; // für Vorname falls keine Anrede
$anredeGross = ucfirst($_POST[anrede]);
if ($anredeGross === "Herr") {
$anredeGross = $anredeGross . "n";
} elseif ($anredeGross === "Leer") {
$anredeGross = $vorn;
} else {
$anredeGross = $anredeGross;
}
$firma = $_POST['firma'];
if ($firma !=='') {
$firma = …Run Code Online (Sandbox Code Playgroud)我有一个带有文本框的表单,然后是另一个带有三个文本框的表单.当我单击按钮时,我在第一个文本框中输入的文本(id ="logoName")应该在其他三个(ids v1 - v3)中可见.我尝试了下面这个,但是当我点击按钮时,第一个框中的文字就会消失,而不是在其他框中显示...我做错了什么?非常感谢你的帮助!!!
JS
var logoName = document.getElementById("logoName");
var v1 = document.getElementById("v1");
var v2 = document.getElementById("v2");
var v3 = document.getElementById("v3");
var button = document.getElementById("button");
function sync() {
v1.value = logoName.value;
v2.value = logoName.value;
v3.value = logoName.value;
}
button.onclick = sync();
Run Code Online (Sandbox Code Playgroud)
CSS
p {
font-size: 2em;
float: left;
margin-right: 2em;
}
.clear {
clear: both;
}
.overview {
margin-top: 2em;
}
input[type="text"] {
font-size: 2em;
width: 200px;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<form>
<label>Logo-Name</label>
<input id="logoName" type="text"/>
<button id="button">synchronise</button>
</form>
<form class="overview"> …Run Code Online (Sandbox Code Playgroud)