note 60623 added to features.http-auth

From: Date: Thu, 12 Jan 2006 15:19:17 +0000
Subject: note 60623 added to features.http-auth
Groups: php.notes 
Request: Send a blank email to php-notes+get-101633@lists.php.net to get a copy of this message
A better example of the solution Brian was suggesting [admins: please delete my previous post] logout.php: <?php if (!isset($_GET['quit'])) { ?> <h4>To complete your log out, please click "OK" then "Cancel" in this <a href="logout.php?quit=y">log in box</a>. Do not fill in a password. This should clear your ID and password from the cache of your browser. <blockquote>Note: Logging in from this particular box is disabled!</blockquote> <p>Go <a href="/">back to the site</a>.</h4> <?php } else { header('WWW-Authenticate: Basic realm="This Realm"'); header('HTTP/1.0 401 Unauthorized'); // if a session was running, clear and destroy it session_start(); session_unset(); session_destroy(); echo "<h3>Logged out!</h3><h4>Go <a href=\"/\">back to the site</a>.</h4>"; } ?> Note: "This Realm" should be changed to precisely match the name of your realm in your main login. ---- Manual Page -- http://www.php.net/manual/en/features.http-auth.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60623 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60623&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60623&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60623&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60623&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60623&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60623&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60623&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60623&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#101633) next »