帮忙看看了,我最近上上传了一个网站,web hosting要求,一定是index.html,而我当初开发的时候,写的是index.php。我现在再把首页改成 index.html , 但是遇到一个问题,就是改好的html不能正确的嵌入 php.我看了一下html源代码,有一行竟然是这么写的。html竟然把我的php卸载了源代码里面。这应该怎么办呢?
<b>Date: <?php echo "aaa";?> | Today Visitors: <?echo "BB";?> | Total Visitors: <? echo "CC";?></b>

解决方案 »

  1.   

    不用这么麻烦。
    建一个index.html文件,里面写入一句:<meta http-equiv="refresh" content=".2;URL=/index.php" />
      

  2.   

    html格式页中php代码无效
    你可以用模板
      

  3.   

    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    <IfModule dir_module>
        DirectoryIndex index.php
    </IfModule>
    apache里设置下默认起始文件。
      

  4.   

    楼主看来是新手:
    1、
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    <IfModule dir_module>
      DirectoryIndex index.php
    </IfModule>
    apache里设置下默认起始文件。
    2、.html文件不支持php代码;.php文件可写html代码。
      

  5.   


    检查一下空间是不是只支持纯静态页面,根据你的描述应该是只支持静态页面,要正确运行PHP程序必须使用支持PHP的空间