I have a problem with including pages in PHP. The figure shows what I want to do. I want to include index.php pages in the horizontal and vertical menus. But now I can turn on only one of them. In global.php there is a database name, password and variable that determine which language I am using now. I included all the tricks: include, include_once, require, require_once. Nothing helps. What can you offer me? Thanx!

EDIT:
Here is my code:
Index.php:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>KUSS</title>
<link href="styles/default.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="main_border">
<?php
include_once ("modules/php/mainMenu.php");
?>
<? include_once ("modules/php/vertMenu.php"); ?>
</table>
</body>
</html>
global.php
<?php
$gl_Lang = "UKR";
$gl_MaimMenuChoice;
$gl_SubMenuChoice;
$gl_dbName = "127.0.0.1";
$gl_UserName = "user1";
$gl_Password = "12345";
$gl_adminDatabase = "admin";
?>
makeHoriz.php and makeVert.php are identical, except for one read from db and displaying rows and second columns
<?php
function MakeLeftVMenu($tableName, $levelID, $parentName)
{
include_once ("modules/php/globals.php");
$db = mysql_connect($gl_dbName, $gl_UserName, $gl_Password ) or die ("Unable to connect");
mysql_query("SET NAMES 'UTF8'");
mysql_select_db($gl_adminDatabase, $db);
$sql = "SELECT " .$gl_Lang. ", Link FROM ". $tableName." WHERE LevelID = ".$levelID. " AND ParentName = '". $parentName."'";
echo $sql;
$result = mysql_query($sql, $db);
$myRow = mysql_fetch_array($result);
do
{
echo "<tr><h3><a href=".trim($myRow['Link']).">". trim($myRow[$gl_Lang]) ."</a></h3></tr>";
}while($myRow = mysql_fetch_array($result));
mysql_close($db);
}
?>
source
share