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