动态网站标题

时间:2014-03-21 10:56:57

标签: php dynamic title

我创建了这个动态网站。它工作得很好,但我有一个问题。 如何为每个页面(在html标记中)提供一个invidiual标题。 我希望你明白我的意思。 看看我的index.php

<html>
    <?php
    include_once 'config.php';
    include_once 'includes/mysqlconnect.php';
    $url_slash=$_SERVER['REQUEST_URI'];
    $url= rtrim($url_slash, '/');
    //$url = basename($url);
    ?>
    <head>
        <meta charset="UTF-8">
        <title>KasCraft | *********</title> //Here I need a variable or some other to display the title for each site
        <link rel="stylesheet" type="text/css" href="<?php echo $domain;?>themes/reset.css">
        <link rel="stylesheet" type="text/css" href="<?php echo $domain;?>themes/<?php echo $theme;?>.css">
    </head>
    <body class="body">
        <div class="container-all">
            <?php include_once 'includes/header.php';?>
            <div class="container">
                <?php include_once 'includes/navigationbar.php';?>
                <?php include_once 'includes/rightsidebar.php';?>
                <div class="content"><?php

                if ($url==''){

                    include_once "sites/home.php";
                }
                elseif (file_exists("sites/$url.php") && is_readable('/var/www/html/sites/'.$url.'.php')){
                    include_once '/var/www/html/sites/'.$url.'.php';

                }

                else {
                    include_once 'sites/404.php';

                }


                ?></div>
                <?php include_once 'includes/footer.php';?>
            </div>
        </div>
    </body>
</html>

任何人都可以帮助我。

0 个答案:

没有答案
相关问题