chicote Posted February 18, 2020 at 02:30 PM Report Share #617378 Posted February 18, 2020 at 02:30 PM Olá, Em primeiro peço desculpa se a pergunta não for bem estruturada. Estou a contruir um sistema de gestão de conteudo/stocks e afins.. Deixo em baixo um print screen onde tento explicar como esta estrurada as pastas/directorias. No ficheiro index.php tenho o seguinte: <?PHP require_once('sistema/functions.php'); require_once('control/head_load_script.php'); corpo_main(); require_once('control/footer.php'); ?> No ficheiro root/sistema/functions.php tenho as seguintes funcções: function getLang(){ if(!empty($_SESSION['usuarioID']) == '' ){ if(isSet($_GET['lang'])){ $lang = $_GET['lang']; $_SESSION['lang'] = $lang; setcookie("lang", $lang, time() + (3600 * 24 * 30)); } else if(isSet($_SESSION['lang'])){ $lang = $_SESSION['lang']; } else if(isSet($_COOKIE['lang'])){ $lang = $_COOKIE['lang']; } else{ if(getSystemInfo('site_lang') == ''){ $lang = "pt"; } else { $lang = getSystemInfo('site_lang'); } } include_once 'lang/lang.'.$lang.'.php'; } else { $lang = getuserinfo('lang'); include_once 'lang/lang.'.$lang.'.php'; } DEFINE('langTag', $lang); } getLang(); function corpo_main(){ if (!isset($_SESSION['usuarioID'])) { session_destroy(); require_once('control/login.php'); } else { require_once('control/header.php'); require_once('control/corpo.php'); } } Nos ficheiros root/lang/lang.pt.php ou lang.en.php tenho o seguinte: (entre outras traduções) DEFINE('users','Utilizadores'); No ficheiro root/js/main.js tenho: getPage = function(page,title){ $("#main-panel-body").empty(); $( "#main-panel-body" ).load( "control/loader.html" ); setTimeout(function(){ $( "#main-panel-body" ).load( "sistema/corpos/"+page+".php" ); $("#main-panel-body").empty(); }, 2000); document.title = title; } No ficheiro control/corpo.php, tenho uma DIV Com o ID main-panel-body, quando substituo o conteudo dessa div, atraves do jquery que mostro em cima, pelo conteudo do ficheiro root/sistema/corpos/users.php, não carrega as variaveis em php que o ficheiro users.php tem, como por exemplo variaveis de tradução. Emite um erro. Deixo em baixo o erro: Warning: Use of undefined constant users - assumed 'users' (this will throw an Error in a future version of PHP) in O que estou eu a fazer de mal? Obrigado. Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted February 18, 2020 at 10:54 PM Report Share #617381 Posted February 18, 2020 at 10:54 PM já analizaste no teu browser o que está realmente a acontecer entre o teu browser e o servidor ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now