我目前正在製作一個自動PDF表單。 一切工作已經開始,但問題是,當我回應價格或命名變音符號如ä,ö,ü,ß等將不會顯示。即使是歐元符號也不會顯示。我試圖從發佈的網址使用GET。所以我需要幫助。PHP - 從鏈接參數獲取變音符號
GET參數:
$name = $_GET['name'];
$geb = $_GET['geb'];
$strasse = $_GET['strasse'];
$plz = $_GET['plz'];
$beruf = $_GET[urlencode(beruf)];
$tel = $_GET['tel'];
$mail = $_GET['mail'];
$ek = $_GET['ek'];
$vorbesitzer = $_GET['vorbesitzer'];
$vkpreis = $_GET['vkpreis'];
$sonstige = $_GET['sonsitge'];
$marke = $_GET[urlencode('marke')];
$modell = $_GET['modell'];
$motor = $_GET['motor'];
$km = $_GET['km'];
$fin = $_GET['fin'];
$ez = $_GET['ez'];
爲了測試我只有在我的網址兩個參數:
erstellen?eknr=88&marke=Skoda&beruf=Medienfachmannäöü€$
當我使用進行urlencode它看起來像這樣:
erstellen?eknr=88&marke=Skoda&beruf=Medienfachmannäöü€$
我如何創建我的網址:
<script type="text/javascript">
window.location = "erstellen?<?php $conn = new mysqli($servername, $username, $password, $dbname);
$sql = "SELECT * FROM `Fahrzeugverkauf` WHERE EKNR = $ek";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$query_string = 'eknr=' . rawurlencode ($row[EKNR]) . '&marke=' . rawurlencode ($row[Marke]). '&beruf=' . rawurlencode ($beruf);
echo htmlentities($query_string) ;
}
} ?>"
我的輸出看起來像這樣:
$pdf->useTemplate($tplIdx, 0, 0, 210);
$pdf->SetFont('Times','B', 10);
$pdf->SetXY(158, 4.2);
$pdf->Write(4, '13-12-2016');
$pdf->SetXY(36.2, 24.6);
$pdf->Write(4, $name);
$pdf->SetXY(162.6, 24.7);
$pdf->Write(4,$geb);
$pdf->SetXY(35.3, 31.3);
$pdf->Write(4,$strasse);
$pdf->SetXY(85, 31.3);
$pdf->Write(4,$plz);
$pdf->SetXY(31.2, 37.6);
$pdf->Write(4,urldecode($beruf));
$pdf->SetXY(155, 37.6);
$pdf->Write(4,'?????üüßßßßüüü€??');
$pdf->SetXY(54, 59.5);
$pdf->Write (4, urldecode($marke));
$pdf->SetXY(102, 59.5);
$pdf->Write(4,$modell);
$pdf->SetXY(40, 66.2);
$pdf->Write(4,$ez);
$pdf->SetXY(78, 66.2);
$pdf->Write(4,$motor);
$pdf->SetXY(122.8, 66.2);
$pdf->Write(4,$fin);
$pdf->SetXY(70, 79.2);
$pdf->Write(4,$km);
$pdf->SetXY(38, 85.3);
$pdf->Write(4,$vorbesitzer);
$pdf->SetXY(52, 92);
$pdf->Write(4,$vkpreis);
$pdf->Image('checkbox.jpg', 63.8, 130,5,5);
$pdf->Image('check-box.png', 63.8, 160,5,5);
$pdf->Image('checkbox.jpg', 63.8, 192.5,5,5);
$pdf->Image('check-box.png', 63.8, 227.6,5,5);
所以我面臨的問題是,我不能使用,因爲使用FPDF IM元參數。任何人都可以幫忙
你如何創建'url'?你能提供代碼嗎? 'urlencode'應該可以工作。也許這是錯的。 –
更新了它,我認爲它很簡單 –