On Mon, 17 Dec 2001 20:11:46 +0100, Thomas Finnerup <TF@Picco.dk>
wrote:
>Nu har du ikke angivet, hvad du skriver i din header(), men hvis du
>f.eks. skriver header("
http://www.blah.org/"), vil det ikke virke, da
>det ikke er en gyldig HTTP-header. Du skal i stedet skrive
>header("Location:
http://www.blah.org/").
Den har jeg med for det er "færdig kode".
Jeg har fundet løsningen på problemet. Jeg er lidt newbie, så jeg er
ikke helt sikker på hvorfor, men det der gav bonus var denne tekst:
<lang forklaring>
Under linux & php 4.0.6 cgi & netscape 4.78, the admin login/logout
does not work normally. You have to login/logout twice so as to
enter/exit admin.
I guess there are two reasons.
The first one is : "HTTP/1.1 requires an absolute URI as argument to
Location"
See
http://www.php.net/manual/en/function.header.php
The second one is : "Cookies will not become visible until the next
loading of a page that the cookie should be visible for."
See
http://www.php.net/manual/en/function.setcookie.php
My fix consists in two things :
replace all
Location: $PHP_SELF
by
Location:
http://".$HTTP_SERVER_VARS['HTTP_HOST'].$HTTP_SERVER_VARS['PHP_SELF']
except in login.php
where I replace line 39 [header("Location: $PHP_SELF");]
by
echo(sprintf("<script
language=\"javascript\">document.location.href='%s';</script>",$PHP_SELF));
</lang forklaring>
/Mads