.php和.html文件以及外部文件不';行不通

.php和.html文件以及外部文件不';行不通,php,javascript,html,Php,Javascript,Html,你好,我有下面的代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type

你好,我有下面的代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />

        <link rel="stylesheet" href="lib/css/css6f31.css?page=login" type="text/css" />
        <script src="lib/js/jquery.js" type="text/javascript"></script>
        <script src="lib/js/js6f31.php" type="text/javascript"></script>

    </head>
    <body id="page-login">





        <div id="content">

<div id="forgot" class="form-wrap">
    <form id="form-forgot" action="#" method="post">
        <fieldset class="inputs glow-container">
             <label for="forgot-email">Email</label>
             <!--  value="Enter your email address" -->
            <input type="text" class="last text" id="forgot-email" tabindex="1" name="forgotEmail" />
        </fieldset>
        <fieldset class="buttons">
            <a href="#" id="forgot-cancel" class="button hoverfade">Cancel</a>
            <a href="#" id="forgot-send" class="button button-submit hoverfade">Send Password</a>
            <div class="spinny"></div>
        </fieldset>
    </form>
</div>

<div id="login" class="form-wrap">
    <form id="form-login" action="#" method="post">
        <fieldset class="inputs glow-container" style="height: 167px;">
            <label for="login-email">Email</label>
            <input type="text" class="text" id="login-email" tabindex="2" name="loginEmail" value="" />

            <label for="login-password">Κωδικός <a id="forgot-link" href="#">υπενθύμιση κωδικού!</a></label>
            <input class="last text" type="password" id="login-password" tabindex="3" name="loginPassword" />
            <label><a id="signup-link" href="#">δημιουργία λογαριασμού!</a></label>
        </fieldset>
        <fieldset class="buttons">
            <div class="spinny"></div>
            <a id="login-login" class="button button-submit hoverfade">Log in</a>
            <button type="submit" style="height: 0; width: 0; border: 0;"></button>
        </fieldset>
    </form>
</div>



        </div>
    </body>

</html>

电子邮件
电子邮件
Κωδικός 
登录
当文件名为index.html时,当我将其重命名为index.php时,一切正常,它不会加载css文件或javascript文件。

检查此链接--


编辑


请确保您正在通过web服务器运行此
.php
文件。

此行错误。您不能在src中调用php文件。src只能调用在客户端站点中执行的文件,如javascript文件、vbscript文件等

<script src="lib/js/js6f31.php" type="text/javascript"></script>

请使用此代码:

<script type="text/javascript">
    <?php include 'lib/js/js6f31.php'; ?>
</script>


即使我删除了,也不会改变still@MpampinosHolmens你在哪里放置这些文件???你确定你设置的路径正确吗?是的,我确定路径是正确的,我已经安装了php,这就是为什么我想知道这是不正常的,这就是为什么我贴在这里!您不仅需要安装php,还需要实际解析文件如何查看页面?不要忘记PHP文件需要由服务器解析…这是不正确的-您可以将PHP文件的头设置为
头(“内容类型:text/javascript”)
,即使文件扩展名仍然是
.php
<script type="text/javascript">
    <?php include 'lib/js/js6f31.php'; ?>
</script>