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 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器