如何将我的代码从PHP更改为HTML?

时间:2015-11-07 02:10:49

标签: php html css html5

我的网站有一些代码没有正确托管PHP。切换到兼容PHP的服务器不是一种选择。如何将其更改为HTML?

index.php:

    <head>
        <link rel="stylesheet" type="text/css" href="CSS/index.css">
        <?php
        include("common/common.php")
        ?>
    </head>
    <body>
        <?php
            commonheader()
        ?>
        <h1>Coming Soon!</h1>

common.php:

<head>
    <link rel="stylesheet" type="text/css" href="common.css">
</head>
<?php
    function commonheader()
    {
        ?>
        <div class="header"
            <nav>
                <a href="index.php"><button type="button">Home</button></a>
                <!--First Case (unnamed)-->
                <button type="button"><span class="comingsoon">Coming soon!</span></button>
                <!--Second Case (unnamed)-->
                <button type="button"><span class="comingsoon">Coming soon!</span></button>
                <a href="help.php"><button type="button">Help</button></a>
            </nav>
        </div>
        <?php
    }
?>

如果我需要附加CSS文件,我可以。

1 个答案:

答案 0 :(得分:1)

您只需要移除php code并仅使用html

    <head>
        <link rel="stylesheet" type="text/css" href="CSS/index.css">

    </head>
    <body>
        <div class="header">
            <nav>
                <a href="index.html"><button type="button">Home</button></a>
                <!--First Case (unnamed)-->
                <button type="button"><span class="comingsoon">Coming soon!</span></button>
                <!--Second Case (unnamed)-->
                <button type="button"><span class="comingsoon">Coming soon!</span></button>
                <a href="help.html"><button type="button">Help</button></a>
            </nav>
        </div>

        <h1>Coming Soon!</h1>