标准编码...... [英] standard coding...
问题描述
大家好,
我想知道在
页面上混合PHP和HTML脚本时是否有标准......如果有的话关于这个主题的任何文章......
即我是否在我的网站上将每个页面设为.php页面,并在我需要或者为
时回显html。 ..
我应该在每个页面使用html并在需要时嵌入php ...
显然这仅适用于混合页面php和html的内容是
需要...
例如...哪个更好或更标准....
< html>
< head>
< title> title text< / title>
< / head>
< body>
你的名字是<?php $ name?>
< / body>
< / html>
保存为index.html
或
< ;?php
echo''< html>'';
echo''< head>'';
echo'' <标题> TITL e text< / title>'';
echo''< / head>'';
echo''< body>'';
echo''你的名字是''。$ name;
echo''< / body>'';
echo''< / html> ;';;
?>
保存为index.php
TIA
Andy Mak
Hi all,
I was wondering if there is a standard when mixing PHP and HTML script on a
page... and if there were any articles on this subject...
i.e. do I make every page a .php page on my website and echo html when I
need to or...
should I make every page html and embed php when I need to..
Obviously this only applies to pages where a mixture of php and html is
required...
for example... which is better or more standard....
<html>
<head>
<title>title text</title>
</head>
<body>
You name is <?php $name?>
</body>
</html>
saved as index.html
or
<?php
echo ''<html>'';
echo ''<head>'';
echo ''<title>title text</title>'';
echo ''</head>'';
echo ''<body>'';
echo ''Your name is ''.$name;
echo ''</body>'';
echo ''</html>'';
?>
saved as index.php
TIA
Andy Mak
推荐答案
名称?>
< / body>
< / html>
保存为index.html
或
<?php
echo''< html>'';
echo''< head>'';
echo''< title> title text< / title>'';
echo''< / head>'';
echo''< body>'';
echo''你的名字是''。
name?>
</body>
</html>
saved as index.html
or
<?php
echo ''<html>'';
echo ''<head>'';
echo ''<title>title text</title>'';
echo ''</head>'';
echo ''<body>'';
echo ''Your name is ''.
名字;
echo''< / body>'';
echo''< / html>'';
?>
保存为index.php
TIA
Andy Mak
name;
echo ''</body>'';
echo ''</html>'';
?>
saved as index.php
TIA
Andy Mak
Domestos写道:
Domestos wrote:
大家好,
我想知道在
页面上混合PHP和HTML脚本时是否有标准......如果有关于这个主题的文章......
即我是否在我的网站上将每个页面设为.php页面并在我需要时回显html或者......
我是否应该在需要时将每个页面设为html并嵌入php。 。
显然这仅适用于需要混合使用php和html的页面...
例如...哪个更好或更标准....
< html>
< head>
< title>标题文字< / title>
< / head>
< body>
你的名字是<?php
Hi all,
I was wondering if there is a standard when mixing PHP and HTML script on a
page... and if there were any articles on this subject...
i.e. do I make every page a .php page on my website and echo html when I
need to or...
should I make every page html and embed php when I need to..
Obviously this only applies to pages where a mixture of php and html is
required...
for example... which is better or more standard....
<html>
<head>
<title>title text</title>
</head>
<body>
You name is <?php
这篇关于标准编码......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!