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条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 Win7电脑开机出现硬件设置已更改
      • ¥15 vba代出现莫须有错误,都是一个个复制下来的为啥出错呢?
      • ¥15 /etc/vsftpd/vsftp.conf配置文件加了一行utf8_filesystem=YES之后,启动vsftpd报错
      • ¥15 W5100可以收广播,但是无法发出广播
      • ¥100 PCD点云排序和分割
      • ¥15 GG-CNN抓取数据集
      • ¥15 C++类和对象,多态性,继承,虚函数虚基类
      • ¥15 使用VS2019和Dev c++按%p输出地址,结果相差很大
      • ¥30 有偿解惑TINA老报错,求解惑
      • ¥15 arduino esp8266 编译问题