Re: Redirection if a condition is met



Is http://linux-place.com the URL of the login page?
If it is, why not passing the message to this URL (or a message key):

<?php
session_start();
if (!isset($_SERVER['username']) or !isset($_SERVER['password'])) {

header("location:http://linux-place.com?messageKey=loginBeforeAdminPanel";);
exit;
}
?>

and, in the login PHP page :

<?php
$message = getMessageFromKey($_GET["messageKey"]);
// display the message
// display the login form
?>

You should even pass the URL of the page requested before the redirect
to the login page, and redirect to this URL once the login is
successful. (Or put this URL in the session before the redirect to the
login page, and redirect to this URL after the login is successful).

JB.

.



Relevant Pages

  • Re: Custom redirectURL
    ... > In Forms based authentication mode, say my login page has to be ... > redirected to "db.aspx" if the login was successful, ... > this redirect without a Response.Redirectusing FormsAuthentication ...
    (microsoft.public.dotnet.languages.vb)
  • Re: .NET forms authentication role-based redirection?
    ... I would consider using a Login View control. ... means of a redirect (maybe examine the Response object to determine this. ... If the page is NOT a redirect you could display some ... I think a View control would probably work easiest. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Default.aspx - newbie Q`
    ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Default.aspx - newbie Q`
    ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: doesnt redirect
    ... Look under the Security tab. ... One of them is called the Internet zone and probably the one you are using. ... or better explain what you mean by>> redirect ... I think there are 2 interstitchal pages after submitting those login credentials before you get to the mailbox web page. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)