Re: question about header and validation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?>") or meta (<meta http-equiv="refresh" content="<?=$timout?>; url=<?=$url?>" />).
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]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux