doubiao7410 2012-09-23 13:57
浏览 23
已采纳

我的HTML代码有什么问题?

file omg.html

<!DOCTYPE html>
<html>
    <head><title>:)</title></head>
        <body>
            <?php
                echo 'Hello world';
            ?>
        </body>
</html>

It's supposed to create a webpage which prints Hello world, but it doesn't print anything. What's wrong with it?

  • 写回答

7条回答 默认 最新

  • dqwh1208 2012-09-23 13:58
    关注

    PHP is not HTML.

    You need to run your PHP program through a PHP interpreter to output HTML.

    This is most commonly performed using:

    • A file with a .php file extension
    • A webserver (such as Apache)
    • Having PHP installed

    Other options are available:

    • You can run the file through the command line version of PHP (although this gives you the output at the time and won't be on-demand each time a browser visits the page).
    • You can configure the server to use a different file extension
    • You can configure the server to use a method other than the file extension to determine what is a PHP program.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(6条)

报告相同问题?

悬赏问题

  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数