PHP authentication problem

2006-11-20 1:45 am
Hi, anyone know how to reset the values of $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] ?

回答 (3)

2006-11-26 11:45 pm
✔ 最佳答案
you mean want to logout? Try this:

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();

You can find more examples in the original PHP site
http://hk2.php.net/features.http-auth
2006-11-24 4:32 pm
2006-11-23 6:49 pm
Try to see this website:
http://www.phpdc.com/article_list/2/
It has a lot of teaching source and coding example,
maybe you can find the solution from this website.
Hope you lucky!
圖片參考:http://hk.yimg.com/i/icon/16/1.gif


收錄日期: 2021-04-18 20:21:57
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20061119000051KK04147

檢視 Wayback Machine 備份