Re: reloading a page..
| From: | Beauford.2002 | Date: | Tue, 24 Mar 1998 04:53:32 +0000 |
| Subject: | Re: reloading a page.. | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140797@lists.php.net to get a copy of this message | ||
It's definitely going through the if statement as it does "reload" the
page - print($_SERVER['HTTP_REFERER']); shows
http://www.myserver.com/oldpage.html - which is
correct. print("{$userlevel}
and {$neededlevel}"); also shows the correct info. $no_permission does
have a string, but even if I hard code the message it still doesn't work.
Note though....if I take out include ($_SERVER['HTTP_REFERER']); from the
if statement and put in print($_SERVER['HTTP_REFERER']); and print
$message - they both display.
So I am at a loss....
> No you shouldn't rely on it to do anything important but in your case
> its just where the user will be redirected to. Even if someone fakes
> the referrer to point to the restricted page it will just go into an
> infinite loop.
>
> > if($userlevel != $neededlevel) {
> > include ($_SERVER['HTTP_REFERER']);
> > $message = $no_permission;
> > $exit;
> > }
> >
> > ...on referring page....
> >
> > <? if ($message) { echo $message; } ?>
>
> Code seems fine. You probably are never entering into that if
> statement or the referrer is outputting something unexpected.
> Use some print statements to debug this..
>
> print("{$userlevel} and {$neededlevel}");
> print($_SERVER['HTTP_REFERER']);
>
> Of course make sure $no_permission actually contains a string...
>
> Leo
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>