我有一個HTML腳本( 「index.html的」),其中包括後續的PHP代碼:如何使用WampServer在HTML文件中包含PHP腳本?
< ?php
include ('footer.php');
?>
PHP腳本( 「footer.php」)包含以下代碼:
<?php
echo "Hello world!";
?>
當我運行:index.html:在WampServer上作爲本地主機,將顯示「index.html:」的PHP代碼,如何在「footer.php」中顯示「Hello world!」?
謝謝!
的可能的複製[WAMP服務器不執行PHP代碼](http://stackoverflow.com/questions/10600564/wamp-server-isnt-executing-php-code) –
的[我要如何呈現可能的複製.PHP URL與.html擴展](http://stackoverflow.com/questions/5309490/how-do-i-render-php-url-with-html-extension) – chris85
甲文件只傳遞給PHP coliler如果它以'.php'的擴展名結尾,具有'.html'擴展名的文件不會(默認情況下)通過PHP編譯器 – RiggsFolly