Salve, ho un problema con php5, mi spiego:
ho un sito che fintanto che girava con php4 andava benissimo come hanno fatto l'upgrade passandolo a php5 non si visualizza più nulla.
Considerando che sono un neofita di php ho grossi problemi a capire dov'è il problema, quelli del provider hanno detto che dipende dal fatto che:
"ho fatto dare un'occhiata al suo sito, il problema è che in /hotel/index.php viene utilizzato un array che si chiama $glob (che sembra venga valorizzato dentro /php/gen/startup.php). Tuttavia, quando viene eseguito il codice dentro index.php sembra che il contenuto di $glob in qualche modo vada perso.
Abbiamo provato inserendo alla fine del file startup.php il codice:
echo $glob['pag'], che stampa il valore che viene passato nella query string.
Mentre, la stessa istruzione inserita all'inizio del file index.php, non restituisce nulla.
Questa potrebbe essere una delle cause del problema.
Dovreste quindi indagare in quale parte del codice accade questo problema."
Mi sembra strano comunque approfondendo il problema ho pensato che dipendesse dal FastTemplate ma non ne sono sicuro e dato che non mastico molto bene il php mi ritrovo qui a chiedervi gentilmente se potreste darmi una mano.
Codice index.php:
<?php
include('module_config.php');
include('php/gen/startup.php');
if($_SESSION[PUBLIC_UID])
{
$_SESSION[PUBLIC_ACCESS_LEVEL]=3;
}
else
{
$_SESSION[PUBLIC_ACCESS_LEVEL]=4;
}
if(!$debug)
{
error_reporting(0);
}
if($_SERVER["HTTPS"]!="on")
{
if(substr_count($site_ssl,"https://")>0)
{
if($ssl_pages[$glob['pag']])
{
header("Location: ".$site_ssl."index.php?".$_SERVER["QUERY_STRING"]);
}
}
}
else
{
if(!$ssl_pages[$glob['pag']])
{
header("Location: ".$site_url."index.php?".$_SERVER["QUERY_STRING"]);
}
}
if($glob['act'])
{
include('php/gen/func_perm.php');
list($cls_name,$func_name )=split("-",$glob['act']);
if(($cls_name)&&($func_name)&&(is_file("classes/cls_".$cls_name.".php"))&&($func_access[$cls_name][$func_name]))
{
if($_SESSION[PUBLIC_ACCESS_LEVEL]<=$func_access[$cls_name][$func_name])
{
include("classes/cls_".$cls_name.".php");
$cls_name= new $cls_name;
if (! $cls_name->$func_name($glob))
{
//$glob['error'].="Failed to execute function $func_name";
}
unset($cls_name);
unset($func_name);
}
else
{
$glob['error']= "You are not allowed to run this function !";
}
}
else
{
echo "Can not find cls_".$cls_name.".php class file
";
}
}
if(!$glob['pag'])
{
$glob['pag']="list_rooms";
}
if($glob['pag'])
{
$page=include("php/".$glob['pag'].".php");
if($glob['pr']==1)
{
echo $page;
exit;
}
}
$ftm=new FastTemplate(CLIENT_PATH."templates/");
$ftm->define(array('main'=>"index.html"));
if($_SESSION[PUBLIC_UID])
{
$ftm->assign("LOGIN_TEXT","LOGOUT");
$ftm->assign("LOGIN_LINK","index.php?pag=login&act=au th-logout");
$ftm->assign("START_LOG","");
$ftm->assign("END_LOG","");
}
else
{
$ftm->assign("LOGIN_TEXT","LOGIN");
$ftm->assign("LOGIN_LINK","index.php?pag=login");
$ftm->assign("START_LOG","<!--");
$ftm->assign("END_LOG","-->");
}
foreach ($menu as $menu_id=>$data)
{
$ftm->assign('MENU'.$menu_id,$data['used']);
}
$ftm->assign('SITE_URL',$site_url);
$ftm->assign('SITE_SSL',$site_ssl);
$ftm->assign('CONTENT',$page);
$ftm->parse('CONTENT','main');
$ftm->fastprint('CONTENT');
if($debug)
{
require($script_path."misc/debug.php");
}
?>
In attesa di un Vostro gentilissimo riscontro Vi porgo i miei saluti.
Alessandro