-6
如何在下面的回聲中應用css?我得到它之前,我增加了對UTF編碼的頭工作,但現在它呼應的CSS太讓我的回聲結果是:<p align='center'>Good!!!</p>
在php echo上應用css的正確方法是什麼?
<?php
header('Content-type: text/plain; charset=utf-8');
$answer = $_POST['1'];
if ($answer == "YES") {
echo 'Good!!!';
}
else {
echo 'Try Again!';
}
?>
更正:
<?php
header('Content-type: text/html; charset=utf-8');
$answer = $_POST['1'];
if ($answer == "YES") {
echo "<p align='center'>Good!!!</p>";
}
else {
echo "<p align='center'>Try Again!</p>";
}
?>
你知道什麼'Content-type:text/plain'嗎?即使你不這樣做,如果它在這之前工作,這意味着這種變化打破了它。所以谷歌,並找出原因。 – Jon
此代碼永遠不會回顯'
Esailija
爲什麼您將標題設置爲文本/純文本?它沒有多大意義,但至少將其更改爲'text/html' –