I noticed that Message-ID:
<5f275cd6.0502050532.46c85b73@posting.google.com > from Q contained the
following:
[color=blue]
>But now I do not understand what is the use of header("Location:
>***");. It can be placed only in the beginning of files, and after
>browser open this file it (browser) is immediatly redirected to second
>file. Is it not better to open second file straight away (withou
>opening the first file)?[/color]
Let's say you have a series of pages where you require the user to log
in. You store the log in status as a session variable and then check
for its existence at the start of each page, before any HTML. If it
doesn't exist you can redirect the user to the login page via the header
function.
[color=blue]
>Further, what I need to do if I want to
>diplay some file and than, let say in 20 second, user have to be
>redirected to next file?[/color]
Once the PHP process is over the server has no knowledge of what is
going on at the client side. To redirect in 20 seconds requires a
client side process, ie JavaScript or meta refresh
[color=blue]
>What I need to do if I want to perform
>redirection only if some variables have same defined values?[/color]
Put all the PHP code before any html. <?php must be absolutely the first
thing on your page.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs
http://www.ckdog.co.uk/rfdmaker/