Jump to content

Recommended Posts

Hi to all,

 

i'm not doctor in php,know some and i hope i'll get some help from you :D

 

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

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/67493-www-authentication-problem/
Share on other sites

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??

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.