Re: iis header redirect does not update url

From: Date: Sat, 10 Jul 2004 16:57:31 +0000
Subject: Re: iis header redirect does not update url
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-24137@lists.php.net to get a copy of this message
Jonathan Kart wrote:
Hi everyone, I'm porting an application to an iis server. There is a login process on the app which looks like this: enter username & pass into a form -> submit to a login script which verifies user/pass
    on failure -> go back to login form
    on sucess->redirect to wherever the login form wants to go (there are several different logins, all using the same verification script)
the login redirect looks like this:
    if(!$redirect) $redirect = HOMEPAGE;
    header("Location:".$redirect);
Perhaps I would not assign the home page to $redirect, just play with an else. Also you forgot an space betwen the colon and the URL. After a Header, if you do not want anything else to be executed, its a good practice to write an exit. My proposed code: <?php
    if (isset($redirect)) {
        header("Location: $redirect");
    } else {
header("Location: /user/home.php");
    }
    exit;
?> Hope this helps Regards, Jordi.

« previous php.windows (#24137) next »