我知道,HTML文件里面如果嵌入了一段PHP程序就必须把扩展名改为.php,这样改以后可以在IDE里面运行,怎样让它在浏览器上面运行呢?求高手指点! 比如这段程序:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>只是一个php实例</title>
</head><body>
<?php
echo "<p>This program can be executed only in a PHP file,not in a HTML file</p>",
"<p>Have a try,then you will get the result!</p>";
?></body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>只是一个php实例</title>
</head><body>
<?php
echo "<p>This program can be executed only in a PHP file,not in a HTML file</p>",
"<p>Have a try,then you will get the result!</p>";
?></body>
</html>
http://localhost/你的PHP页面路径和文件名
当然,你还要注意你的WEB端口