PHP不使用ExpressionWeb3

PHP不使用ExpressionWeb3,php,web-applications,expression-web,Php,Web Applications,Expression Web,我开始尝试在使用ExpressionWeb3时学习PHP。我设置了PHP运行时并配置了ini。结果是我的脚本没有按它应该做的那样做 我的页面看起来像: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="ltr" xmlns="http://www.w3.org/19

我开始尝试在使用ExpressionWeb3时学习PHP。我设置了PHP运行时并配置了ini。结果是我的脚本没有按它应该做的那样做

我的页面看起来像:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="en-us" http-equiv="Content-Language" />
<title>Sports</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link href="master.css" rel="stylesheet" type="text/css" />
<style type="text/css">
</style>
</head>

<body>

<div id="masthead">
</div>
<div id="top_nav">
    <ul>
        <li>Sports </li>
        <li>Clubs</li>
        <li><a href="default.html">Cloud</a></li>
    </ul>
</div>
<div id="container">
    <div id="left_col">
    </div>
    <div id="page_content">
    </div>
</div>
<div id="footer">
    <form method="post">
    </form>
</div>
<form action="action.php" method="post">
 <p>Your name: <input type="text" name="name" /></p>
 <p>Your age: <input type="text" name="age" /></p>
 <p><input type="submit" /></p>
</form>
</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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>action</title>
</head>

<body>
Hi <?php echo htmlspecialchars($_POST['name']); ?>.
You are <?php echo (int)$_POST['age']; ?> years old. 
</body>

</html>
然后,我的PHP文件如下所示:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="en-us" http-equiv="Content-Language" />
<title>Sports</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link href="master.css" rel="stylesheet" type="text/css" />
<style type="text/css">
</style>
</head>

<body>

<div id="masthead">
</div>
<div id="top_nav">
    <ul>
        <li>Sports </li>
        <li>Clubs</li>
        <li><a href="default.html">Cloud</a></li>
    </ul>
</div>
<div id="container">
    <div id="left_col">
    </div>
    <div id="page_content">
    </div>
</div>
<div id="footer">
    <form method="post">
    </form>
</div>
<form action="action.php" method="post">
 <p>Your name: <input type="text" name="name" /></p>
 <p>Your age: <input type="text" name="age" /></p>
 <p><input type="submit" /></p>
</form>
</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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>action</title>
</head>

<body>
Hi <?php echo htmlspecialchars($_POST['name']); ?>.
You are <?php echo (int)$_POST['age']; ?> years old. 
</body>

</html>
例如,如果我输入John作为姓名,输入50作为年龄,它应该输出Hi John,您已经50岁了。 但是,它在Firefox上说: 嗨,你今年岁了 在InternetExplorer8中,它只输出整个php脚本。 我不确定哪里出了错


谢谢

您没有从启用PHP的Web服务器运行这些文件,或者Web服务器没有配置为将使用的文件扩展名用作PHP。最好在ServerFault.com上询问如何安装和配置Web服务器。看一看或看一看


此外,你的接受率非常低。为什么不回到前面的一些问题,你问了,并接受了一些你得到的答案?

一切似乎都正常,这不应该发生,你的文件的扩展名是什么?弄明白了,这是因为它运行的是我的html文件和php文件服务器样式