.html vs .php扩展名 [英] .html vs .php extensions

查看:86
本文介绍了.html vs .php扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么当我把这个放在网上时,页面index.html会忽略php内容,而当我将页面保存为index.php时,会显示php内容。



index.html

Why when I put this online the php content is being ignored when having the page index.html, while when I save the page as index.php the php content is displayed.

index.html

<html>
<body>

<h1>Welcome to my home page.</h1>
<?php include 'vars.php';

echo "I have a $color $car"; // I have a red BMW

?>

</body>
</html>





vars.php



vars.php

<?php
$color='red';
$car='BMW';
?>

推荐答案

颜色
color


car; // a red BMW

>

< / body >
< / html >
car"; // I have a red BMW ?> </body> </html>





vars.php



vars.php

<?php


color = ' red';
color='red';


这篇关于.html vs .php扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆