douyan1882 2014-02-10 02:27
浏览 26
已采纳

同一文件中的html和php语法不能正常运行xampp配置

I am new to php. I just installed xampp and php code embedded within html does not work for me. The following is the code for header.php

<?php               
    echo "hi"; /* this works */
?>

    <header>
        <h1 class="brand"><a href="index.html"><img src="img/logo.png" alt=""><span>InvestFirst</span></a></h1>
        <ul class="nav sf-menu clearfix">
          <li class="active"><a href="index.html">Home<span></span></a></li>
          <li><a href="index-1.html">About Us<span></span></a></li>
          <li><a href="contact.php">Contact Us<span></span></a></li>
          <?php
            echo "hello"; /* This does not work */
          ?>
        </ul>
    </header>

I guess I missed out some configuration in xampp. Have added this line at C:\xampp\apache\conf\httpd.conf and at c:\xampp\apache\conf\httpd.conf as well. But this doesnt help

AddType application/x-httpd-php .html .htm

  • 写回答

2条回答 默认 最新

  • douren5490 2014-02-10 05:41
    关注

    Not sure what the issue was. But I uninstalled xampp & installed it again. It is working fine now.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部