[UPHPU] Why doesn't this work the way I expect it to?

David Boucha boucha at gmail.com
Fri Oct 10 08:57:19 MDT 2008


On Fri, Oct 10, 2008 at 8:32 AM, Nathan Lane <nathamberlane at gmail.com>wrote:

> I have a default PHP script in all of my directories and I want them to
> redirect to my error script with some post parameters, or even variables,
> and I've tried both but neither seems to do what I expect it to.
>
> <?php
> $contents = "error";
> $errorNumber = 403;
> $errorMessage = "Access Forbidden";
> header("Location: /?page=error");
> ?>
>
> After that script is run I expect the script associated with /?page=error
> to
> see that $errorNumber and $errorMessage are set, but it doesn't see that.
> Can anybody explain why?


Nathan,

When you redirect the user to /?page=error the variables you set above
aren't sent along. If you want to be able to access them, put them in
session variables instead.

Dave


More information about the UPHPU mailing list