Ben burada küçük bir situaton var. Benim web siteleri biri için özel bir CMS inşa ediyorum.
Aşağıda ana indeks sayfası için kod:
<?php
require("includes/config.php");
include("includes/header.php");
if(empty($_GET['page'])) {
include('pages/home.php');
} else {
if(!empty($_GET['page'])){
$app = mysqli_real_escape_string($db,$_GET['page']);
$content = mysqli_fetch_assoc(mysqli_query($db, "SELECT * FROM pages_content WHERE htmltitle = '$app'")) or die(mysqli_error($db));
$title = $content['title'];
$metakeywords = $content['htmlkeywords'];
$metadesc = $content['htmldesc'];
?>
<h1><?php echo $content['title']; ?></h1><hr /><br />
<div id="content"><?php echo $content['content']; ?></div>
<? } else { include('includes/error/404.php');} }
include('includes/footer.php'); ?>
Dosya / header.php sayfa başlığı ve meta malzeme gibi değişkenleri echo kodu içeren içerir.
Sorun bunun dışında, nerede include("includes/header.php");
olduğu zaman şartlar olursa, tabii ki, ancak, ben, aksi takdirde durumda ev dahil koyamazsınız, varables yankı olmaz Herhangi url değişkenleri gerektirmez sayfa, bu koşullar olmadan gösterecektir.
Ben ne yapmalıyım?