superbo8218 Posted August 31, 2007 Share Posted August 31, 2007 Hi to all, i'm not doctor in php,know some and i hope i'll get some help from you here is my problem: -i have a php script that i use to redirect clients to their pages by username and password. it begins like: header("WWW-Authenticate: Basic realm=\"abcde\""); after the header it contains many blocks as this one: if (($_SERVER[php_AUTH_USER] == "username") && ($_SERVER[php_AUTH_PW] == "password")) { header("Location: location_for_the_user.php"); } It worked just fine untill i reached a number of 1172 clients (blocks like above) . When i want to add new client after the 1172 the script simply wont work; blank page in firefox and "could not find server" in explorer. Any solution?? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/67493-www-authentication-problem/ Share on other sites More sharing options...
LemonInflux Posted August 31, 2007 Share Posted August 31, 2007 I couldn't post the code, but why not have 1 page with an awful lot of arrays that link to a .db.php, .db.txt, .db or SQL and display different information depending on the user? Quote Link to comment https://forums.phpfreaks.com/topic/67493-www-authentication-problem/#findComment-338887 Share on other sites More sharing options...
superbo8218 Posted August 31, 2007 Author Share Posted August 31, 2007 thanks for the post im new (now learning) mysql. maybe for some time for now i could make a datamase with username password and location and then use the database for redirection but till then i think its something about the max size of the cookie that the php script sends to the browser. i've read something abaout output buffering. maybe it will solve the problem... any more suggestions?? Quote Link to comment https://forums.phpfreaks.com/topic/67493-www-authentication-problem/#findComment-338962 Share on other sites More sharing options...
lemmin Posted August 31, 2007 Share Posted August 31, 2007 I would set constants with the name of the user. For example: $username = "location_for_the_user.php"; header("Location: ".${$_SERVER[php_AUTH_USER]}); Then you wouldn't need to do any checks for the link. You would still need to check for the password, I guess, but you should probably do that a little differently. When you have that much data, it is best to use a database. Actually, are all those statements separate if statements or do you have one if and the rest in "else if"'s? If you don't use else if, every single comparison is being done, even after it finds the correct user. Quote Link to comment https://forums.phpfreaks.com/topic/67493-www-authentication-problem/#findComment-338965 Share on other sites More sharing options...
superbo8218 Posted August 31, 2007 Author Share Posted August 31, 2007 thanks, every statement is separate if statement. but i dont know why it works with 1172 of those statements and if i put jus one more it doesnt work help??? Quote Link to comment https://forums.phpfreaks.com/topic/67493-www-authentication-problem/#findComment-338984 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.