IDeea este ca vreau sa fac un site cu mai multe limbi, care se schimba prin $_GET deocamdata.
In index.php am:
Cod: Selectaţi tot
<?php
$languag = (isset($_GET['lng'])) ? $_GET['lng'] : '';
$language = (file_exists('languages/'.$languag.'.php')) ? ''.$_GET['lng'].'.php' : 'English.php';
//Files
include('languages/'.$language.'');
include("functions/DBconnect.php");
include("functions/Posts.php");
//DB Connect
DBconnect();
//Show Posts;
ShowPosts();
?>
Cod: Selectaţi tot
function ShowPosts($id = null){
if($id == null){
$SelectPost = mysql_query("SELECT * FROM `news`") or die(mysql_error());
while($show = mysql_fetch_assoc($SelectPost)){
$id = $show['nId'];
$title = $show['nTitle'];
$content = substr($show['nContent'],0 , 250);
$date = $show['nDate'];
$category = $show['nCat'];
echo '<a href="read.php?nid='.$id.'">'.$title.'</a> '.$post['posted'].' in <a href="category.php?cid='.$category.'">'.$category.'</a> on '.$date.' <br /> <br /> '.$content.' <br /> <br/>';
}
} else {
}
}
Este prima oara cand fac un asemenea "sistem".... Poate ma puteti ajuta.
Thx.