[Wylug-help] HTTP authentication error redirector

lotusblossom@blueyonder.co.uk lotusblossom at blueyonder.co.uk
Thu, 23 Jan 2003 22:41:37 +0000


I could be wrong, but I think you just add it into the header:

Replace your echo with :

header("Location: http://www.stainburn.com/nymr/noentry.html?$secure");

Hope this helps
Rachel
---
Rachel Harding
mailto:LotusBlossom@Blueyonder.co.uk




Gary Stainburn <gary.stainburn@ringways.co.uk>
Sent by: wylug-help-admin@wylug.org.uk
23/01/2003 17:00

        To:     wylug-help@wylug.org.uk
        cc:
        Subject:        [Wylug-help] HTTP authentication error redirector


Hi folks,

I've got the following code which works great on Netscape/Mozilla
browsers.
If the user hits the escape key at the user ID and password window, the
text
specified is rendered in the browser and the user is redirected to the
relevent error page.

However, this doesn't work with MS browsers as they don't honour the
HTTP-EQUIV meta-tag.  Has anyone got a workaround that I could try?

  function getauth($realm) {
    if (!$realm) {
      $realm='Restricted NYMR';
    }
    global $secure;
    header("WWW-Authenticate: Basic realm=\"$realm\"");
    header('HTTP/1.0 401 Unauthorized');
    echo("<html><head><title>Unauthorised access</title><meta
http-equiv=\"Location\"
content=\"http://www.stainburn.com/nymr/noentry.html?$secure\"></head><body></body></html>");
    exit;
  }

--
Gary Stainburn

This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000


_______________________________________________
Wylug-help mailing list
Wylug-help@wylug.org.uk
http://list.wylug.org.uk/mailman/listinfo/wylug-help