-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' –