> I wiped my cache and deleted my cookies. Now print_r() shows the correct
> values.
> Funny thing: still evaluating wrong.
>
> page1.php
> if($key === $u && $code === $p){
> $_SESSION['authorized'] = "yumyum" ;
> header("Location: page1.php");
>
> page2.php
> if($_SESSION['authorized'] != "yumyum" ) {
> header("Location: http://www.google.com");
> }
>
> print($_SESSION)
> 'authorized' = "yumyum"
>
> I must be losing it today as this cant be that hard :)
>
> Wade
This example is different than what you had before. At the top of each script
which uses sessions you need the session_start() function call before anything
is output to the browser (static HTML or print/echo statements). Hence, as I
wrote in the other message, you want your opening PHP tag to be on the first
line starting on the first character position.
The "\r\n" is also important for the header() function call.
In your code samples, I don't see a closing curly brace on the first page. I
also don't see a simicolon after the print_r() function. Is the text below
print_r() a sample output? It looks different than what is normally seen.
James