You are here: Re: [SMARTY] How to change HTTP headers « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] How to change HTTP headers

Posted by Ivo Jansch on 09/29/60 11:27

Hi,

thomas Armstrong wrote:

> But when analyzing my HTTP headers, I get:
> --------
> * Content-Type = text/html; charset=ISO-8859-1
> --------
> What am I doing wrong? Thank you very much.

The problem is that your function is executed only during the initial
rendering of the page. When the page is cached, your function is no
longer executed, and the header no longer output.

If you want to change the headers, it's better not to put them in your
template, but before your call to smarty->fetch, like so:

<?php

....
header("Content-type: text/html; charset=utf-8");
$smarty->display("index.tpl");

?>

There's not much reason to put the header inside the template, neither
from a template designer perspective nor functionality wise, I think.

Greetings,
Ivo

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация