-2
我在HTML代碼中寫道PHP:PHP中的HTML代碼
<div id="loginContainer">
<?php
if(!$_SESSION['id_client']){
print "<a href=\"#\" id=\"loginButton\">";
} else {
print "<a href=\"#\" id=\"loginButton3\">";
}
?>
</a></div>
但是這出現在輸出頁面:;}else { print
我怎樣才能讓PHP執行?
該頁面是否有.php擴展名? – Jonnny
只是一個提示,如果你用單引號將字符串包圍起來,那麼跟蹤引號就會容易得多,所以你不必在字符串中跳過雙引號,有時可能會犯錯。 – jonhopkins
剛剛提出的這個問題也許可以幫助你http://stackoverflow.com/questions/17604336/php-include-function-inside-an-html-file#comment25622804_17604336 – Jonnny