On Wed, 23 Jul 2003 14:48:03 -0600, Kevin Stone wrote:

>Beauford, here's a login routine that I wrote using Sessions and Header
>redirects.  It is my interpretation of what you are trying to do.  I'm not
>saying this is the only way to do it but it works well for me.  Compare it
>to what you're doing to see if you're doing anything wrong.
>
>page-whatever.php
><? // <-- line 1
>session_start();
>$thispage = "http://www.yourdomain.com".$_SERVER['REQUEST_URI'];
>$_SESSION['return-to'] = $thispage;
>if($_SESSION['valid_user'] !== true)
>{
>    // Access Denied!  Redirect to the login screen.
>    header("Location: http://www.yourdomain.com/login.php";);
>    exit;
>}

Ok, I have a question.  Where is $_SESSION['valid_user'] getting set
(or unset)???  

Have you checked to see if your IF statement at the top of the script
is working like you think it should be??  Try putting an echo in
instead of the header() call and see if you get the output you think
you should.

I suspect this isn't a "redirect isn't working" issue at all but a "the
if isn't working like I thought it would" issue.  :)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to