|
Posted by K. A. on 05/06/07 09:28
On May 5, 2:03 pm, "K. A." <ka5...@hotmail.com> wrote:
> On May 5, 12:18 pm, Michael Fesser <neti...@gmx.de> wrote:
>
>
>
>
>
> > .oO(K. A.)
>
> > >==>>> The resulting pagehttp://vector/test/testvariables.phplooks
> > >like:
> > >session started
> > >UserName: ( )
> > >Password: ( )
>
> > >Session variables have not been passed across!
> > >PS. I'm using PHP version 4.3.10, with Apache 1.3.12 (I think!)
>
> > >In the error log, it says:
> > >Undefined index: userid in testvariables.php on line 5
> > >Undefined index: password in testvariables.php on line 6
>
> > >I'm quite new to PHP, please help!
>
> > How's the session ID stored on the client, in a cookie or appended to
> > the URLs? If it's not stored in a cookie, it will get lost in step 2
> > when the script redirects.
>
> > You could try this:
>
> > if (...) {
> > header('Location:http://example.com/test/testvariables.php?'.SID);
> > exit;
>
> > } else {
> > ...
> > }
>
> > Micha
>
> OK, I have appendid the session id and it showed in the next page's
> URL, then what?
> the variables are still lost!- Hide quoted text -
>
> - Show quoted text -
Back again,
I guess I know where the problem is. I found out that session
variables are somewhat lost when I use the "header" function as in:
header('Location: http://example.com/test/testvariables.php);
User is correctly taken to the personalised page using the above line,
but then the session variables get lost!
My question now is: once I found out the userid and I know what page
to take him to, what is the best way to re-direct him to that page
without losing session variables?
[Back to original message]
|