douyan1882 2014-02-10 10: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 13:41
    关注

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

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

报告相同问题?

悬赏问题

  • ¥15 想用@vueuse 把项目动态改成深色主题,localStorge里面的vueuse-color-scheme一开始就给我改成了dark,不知道什么原因(相关搜索:背景颜色)
  • ¥20 OPENVPN连接问题
  • ¥15 flask实现搜索框访问数据库
  • ¥15 mrk3399刷完安卓11后投屏调试只能显示一个设备
  • ¥100 如何用js写一个游戏云存档
  • ¥15 ansys fluent计算闪退
  • ¥15 有关wireshark抓包的问题
  • ¥15 需要写计算过程,不要写代码,求解答,数据都在图上
  • ¥15 向数据表用newid方式插入GUID问题
  • ¥15 multisim电路设计