我有一些麻煩與我的CMS。 (我自己的CMS)我有麻煩與我的PHP/HTML/MySQL的CMS
如果我寫www.example.com/example它工作正常,但如果我寫www.example.com/example/的/例子內容dosent表演。僅顯示標題,導航標題,側邊欄和頁腳。
我需要寫在SITE_CONTENT PHP代碼(在MySQL表)目前我只能寫HTML)
看來,谷歌的蜘蛛不能找到我的網頁。什麼辦法可以創建谷歌站點地圖(站點地圖,需要的時候我在mysql表中添加一個新的頁面(網站)的MySQL
數據庫
結構得到automaticaly更新:網站 表:網站 SITE_ID SITE_LINK
SITE_TITLE SITE_CONTENT
我的index.php
<html>
<?php
include_once 'includes/mysqlconnect.php';
$url=$_SERVER['REQUEST_URI'];
$query = mysql_query("SELECT * FROM sites WHERE site_link = '$url' OR site_link = '$url/'");
WHILE($rows = mysql_fetch_array($query)):
$site_id = $rows['site_id'];
$site_link = $rows['site_link'];
$site_title = $rows['site_title'];
$site_template = $rows['site_template'];
$site_content = $rows['site_content'];
endwhile;
?>
<head>
<meta charset="UTF-8">
<title>KasCraft | <?php echo $site_title;?></title>
<LINK rel="stylesheet" type="text/css" href="http://kascraft.com/themes/default.css">
</head>
<body class="body">
<div class="container-all">
<div><?php include_once 'includes/header.php';?>
</div>
<div class="container">
<div><?php include_once 'includes/navigationbar.php';?></div>
<div><?php include_once 'includes/rightsidebar.php';?></div>
<div class="content">
<?php echo $site_content;?>
</div>
<div>
<?php include_once 'includes/footer.php'; ?>
</div>
</div>
</div>
</body>
</html>
而且我的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
任何人可以幫我?
將php代碼存儲在mysql數據庫中並不是一個好主意。你有沒有聽說過模板引擎樹枝?它可能一開始有點多,但它也可能是......好......少了1995 ;-) –
那麼,有沒有辦法呢? – KaareZ
當然。如果你拼命想這樣做,請查看http://us3.php.net/manual/de/function.base64-encode.php和http://us3.php.net/manual/de/function.base64- decode.php –