shakeelstha Posted March 16, 2008 Share Posted March 16, 2008 <?php ob_start(); session_start(); $auth_user="manager"; $auth_pwd="manager"; if($_SERVER['PHP_AUTH_USER']==$auth_user && $_SERVER['PHP_AUTH_PW']==$auth_pwd && $_SESSION['authorized']==1) { include_once("session.php"); open_session_admin($auth_user); header("Location: resadmin.php"); //echo "you are logged in......</ br>"; } else { $_SESSION['authorized']=1; authenticate(); } function authenticate() { header('WWW-Authenticate: Basic realm="Enter Your Login detail to access the page"'); header('HTTP/1.0 401 Unauthorized'); echo "You must enter a valid login ID and password to access this resource\n"; exit; } ?> This code runs well in localhost in windows platform. But after uploading it to linux server, it doesn't work. What is the problem? Link to comment https://forums.phpfreaks.com/topic/96359-http-authentication-problem/ Share on other sites More sharing options...
Daniel0 Posted March 16, 2008 Share Posted March 16, 2008 How doesn't it work? Link to comment https://forums.phpfreaks.com/topic/96359-http-authentication-problem/#findComment-493244 Share on other sites More sharing options...
unsider Posted March 16, 2008 Share Posted March 16, 2008 Like daniel0 said, any error messages, anything else for us to go on, there may be dozens of possible problems, possibly even out of our scope. Link to comment https://forums.phpfreaks.com/topic/96359-http-authentication-problem/#findComment-493254 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.