[Cartoweb-users] Retrieving a Smarty Variable from cartoclient.tpl
	and writing its contents to a html file
    Max Ueda 
    mhanzo at yahoo.com
       
    Fri Nov 10 13:59:00 EST 2006
    
    
  
Hi,
Because of my lack of knowledge about how Smarty
works, I've been unable to solve this issue: I'm
trying to retrieve the values of a  Smarty variable
into a {php} {/php} section, located inside the
./projects/MyProject/templates/cartoclient.tpl . 
The problem is simple, I wish to have the
query_by_bbox results to be written inside a html
file. I have realised that those results are stored
inside the cartoclient.tpl Smarty variable,
$tables_result. So, I've developed this simple piece
of php code:
{php}
  $tablesResult = $tables_result;
  $file = fopen("messagem.html","w");
  $tag1= "<html><head><title></title></head><body>";
  $tag2="</body></html>";
  fwrite($file,$tag1);
  fwrite($file, $tablesResult);
  fwrite($file, $tag2);
  fclose($file);
{/php}
But it generates a blank html file (messagem.html).
What is wrong with this piece of code? Is it possible
to have this working that way (inside the
cartoclient.tpl file)?
Thanks in advance,
Max H. Ueda
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
    
    
More information about the Cartoweb-users
mailing list