Re: iis header redirect does not update url

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux