I've often the need to understand why I got a useless blank html page as a result.
Let me show you my case:
main prg: index.php
it just calls a template:
$TBS = new clsTinyButStrong;
$TBS->LoadTemplate($Template_dir.'tbs_AllInOne.tmpl');
$TBS->Show() ;
|
tbs_AllInOne.tmpl:
...omitted...
<div id="menulist">
[onload;script=sub_menu.php;subtpl]
</div>
<div id="bodypart">
[var.Messaggio;htmlconv=no]
[onload;script=sub_view.php;subtpl]
</div>
...omitted...
|
Now... I really got stucked!!!
I can't really understand why I get a blank page calling the sub_view.php,
while I get a full and correct answer from calling sub_menu.php.
If I launch the script by themself I get the correct results from both.
Both the scripts do quite the same thing.
sub_menu.php (the one that does what I expect)
<?php
if (isset($this)) {
$TBSa =& $this;
} else {
include_once('tbs_class.php') ;
$TBSa = new clsTinyButStrong;
}
include('lib/vars.inc');
global $LOGGED;
global $userParms;
global $Messaggio;
if ($_SESSION['logged'] == 0) {
$Messaggio="viene fuori quando non sono loggato";
} else {
$qry_str="SELECT descr, codice from gradi where id_grado=(select id_grado FROM utenti WHERE nick = '".$_SESSION['nick']."')";
$userParms = query_DB($qry_str);
}
$TBSa->LoadTemplate($Template_dir.'21_menu.tmpl') ;
$TBSa->Show() ;
?> |
and the other script (the 'damned one'):
<?php
if (isset($this)) {
$TBSa =& $this;
} else {
include_once('tbs_class.php') ;
$TBSa = new clsTinyButStrong;
}
include('lib/vars.inc');
include('lib/common.db.inc');
global $LOGGED;
$qry_str='select e.id_evento, e.data_evento, c.rag_soc, concat(u.cognome,\', \',u.nome) as nome, e.descr as edescr, e.note, s.descr as sdescr from eventi e, ana_cli c, stato s, utenti u where e.id_cli=c.id_cli and e.id_utente=u.id_utente and e.id_stato=s.id_stato';
if ($_SESSION['logged'] == 0) {
$Messaggio="viene fuori quando non sono loggato e chiamo la pagina view";
} else {
$TBSa->LoadTemplate($Template_dir.'tbs_view.tmpl') ;
$conn_al_db=db_connect();
$TBSa->MergeBlock('blkView',$conn_al_db,$qry_str);
$TBSa->Show() ;
}
?> |
By the way, probably I wasn't so clear in the examples above.
But the one think I really have to know is: how can i manage the blank pages,
because i don't have any feedback to debug the errors I made.
Thanks in advance for any help.