List Info

Thread: Re: question about header and validation




Re: question about header and validation
country flaguser name
United States
2008-03-03 22:38:00

hi,
for your first question, you can also use streams. you can ob_start() the the beginning of your first file, and do all the "echo"s and stuff, which will be stored in the stream's buffer and won't go directly to the output; then use header() whenever you want.
the output buffer will be flushed at the end of the page, which will cause all the data to be shown. you can also ob_flush() it at any time.
and another thing you have to consider: header takes full url, not just the filename, i.e header("http://example.com/filename.html"). if given otherwise, it won't work properly.
you have also other choices than using header, like javascript (window.location.href="<;?=$url?&gt;") or meta (<meta http-equiv="refresh" content=&quot;<?=$timout?>;; url=<?=$url?>&quot; />).
as my last suggestion, it's better to use a die() after redirection, in order to make sure it really works, and the rest of the code won't be run...
cheers,
Arash Dalir.

__________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )