PHP-是的,HTML-No ---为什么? [英] PHP-Yes, HTML-No --- Why?
问题描述
大家好,
我有一个小程序:
<!doctype HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN"
" http://www.w3.org/TR/html4/strict.dtd">
< html>
< head>
< title> MyTitle< / title>
< meta http-equiv =" Content-Type" content =" text / html;
charset = iso-8859-1" />
< / head>
<正文>
<?php
$ host = $ _SERVER [''HTTP_HOST''];
$ server = strtolower($ host);
echo''我的变量< bg>'';
echo("< br> Host :$ host");
echo(< br>服务器:$ server");
?>
< / body>
< / html>
我将它作为test.html和test.php上传到我的网络服务器。然后我在我的webbrowser中测试它们的价值。 test.html不起作用,但test.php
的确如此。有人可以告诉我为什么吗?
很困惑
Lennart Bj?rk
Hi All,
I have a tiny program:
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>MyTitle</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"/>
</head>
<body>
<?php
$host = $_SERVER[''HTTP_HOST''];
$server = strtolower($host);
echo ''My variables<bg>'';
echo("<br>Host: $host");
echo("<br>Server: $server");
?>
</body>
</html>
I upload it to my webserver as test.html and as test.php. Then I test
them in my webbrowser. The test.html does not work, but the test.php
does. Can someone tell me why?
Very confused
Lennart Bj?rk
推荐答案
host =
_SERVER [''HTTP_HOST''];
_SERVER[''HTTP_HOST''];
server = strtolower(
server = strtolower(
这篇关于PHP-是的,HTML-No ---为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!