I'm creating a Server Side php Website application. In my first page , the whole code is php , and I've set
$_SESSION["lang"] = 'lang.en.php';
$_SESSION["lang"] = 'lang.it.php';
When I change flag, I change a variable :
if (Trim($_SESSION["lang"])=='')
{
include 'lang.it.php';
}
if (Trim($_SESSION["lang"])=='lang.en.php')
{
include 'lang.en.php';
}
if (Trim($_SESSION["lang"])=='lang.it.php')
{
include 'lang.it.php';
}
I have the following problem
My second page .php is 50% html and 50% php because in html I put a simple dropdown menu.
My Question is : How can I pass to html my variables from another php page without using Jquery?
<li> <a class="active" href="home.php"><?php $home?></a> </li>
Variable $Home is stored in - lang.it.php -
How di I access to my variables?
P.s. I don't want to pass all Menu's variable in the session because I think is crazy to do..
EDIT -- html
<head>
<link href="Css/Menu.css" rel="stylesheet" type="text/css">
<script>
</head>
<body>
<center ><div id="header"><center >
<ul>
<li><a class="active" href="home.php">Home</a></li>
<li><a href="download.php">Area Download</a></li>
<li class="dropdown">
<a href="javascript:void(0)" class="dropbtn"
onclick="myFunction()">Menù</a>
<div class="dropdown-content" id="myDropdown">
<a href="/Page1.php">VARIABLE 1 HERE</a>
<a href="/Page2.php">VARIABLE 2 HERE</a>
<a href="/Page3.php">VARIABLE 3 HERE</a>
</div>
<li><a href="logout.php">Logout</a></li>
</li>
</ul>
</div>
<center ><div id="Realbody"><center >
<center ><div id="Footer"><center >
</html>
<?php
require_once("rpcl/rpcl.inc.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
use_unit("styles.inc.php");
include 'parameters.php';
//Class definition
class PaginaDownload extends Page
{
public $Label1 = null;
public $LoginCss = null;
function PaginaDownloadShow($sender, $params)
{
if ((empty($_SESSION["name"])) || (empty($_SESSION["user"])))
{
header('Location: \index.php');
}
}
}
global $application;
global $PaginaDownload;
//Creates the form
$PaginaDownload=new PaginaDownload($application);
//Read from resource file
$PaginaDownload->loadResource(__FILE__);
//Shows the form
$PaginaDownload->show();
?>
I've to replace VARIABLE 1 , 2 , 3 with my variable on Lang.php
<li><a class="active" href="home.php">Home</a></li>
<li><a class="active" href="home.php"><?php $home?> </a></li>
That's my try :
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
use_unit("styles.inc.php");
use_unit("Zend/zauth.inc.php");
include '/parameters.php';
if (Trim($_SESSION["lang"])=='') { include 'lang.it.php'; }
else
include Trim($_SESSION["lang"]);
//Class definition
and here my lang file
<?php
/*
------------------
Language: English
------------------
*/
//Login Page #1/X
$title_page_Login = 'Login';
$Err_1_Login = 'Login Credentials Incorrect';
$Err_2_Login = 'Not Found User :';
$Err_3_Login = 'Database Offline';
$Err_4_Login = 'Insert User & Password';
$Err_5_Login = 'Need User';
$Err_6_Login = 'Need Password';
$req_user = 'Insert Username';
$req_pass = 'Insert Password';
$Bt_Label = 'Sign In';
//-------------------
//Home
$home = 'Home';
?>