473,396 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

authentication help

I am using this standard code at the start of my script to request a
user to login. After the user enters information the login box just pops
back up. The script does not move to the else portion after a login is
entered. It just stays in the first part of the if statement. Any help?
if (!isset($PHP_AUTH_USER))
{
header('WWW-Authenticate: Basic realm = "Club"');
header('HTTP/1.0 401 Unauthorized');
echo "Nice try, if you really are supposed to be in here, try again.\n";
exit;
}
else
{
$linkID = @mysql_connect("localhost", "username", "password");
etc....
}

Jul 16 '05 #1
1 1563
On Tue, 02 Sep 2003 23:17:58 -0700
"aquilo at hotmail.com" <"aquilo at hotmail.com"> wrote:
I am using this standard code at the start of my script to request a
user to login. After the user enters information the login box just
pops back up. The script does not move to the else portion after a
login is entered. It just stays in the first part of the if statement.
Any help?
if (!isset($PHP_AUTH_USER))
{
header('WWW-Authenticate: Basic realm = "Club"');
header('HTTP/1.0 401 Unauthorized');
echo "Nice try, if you really are supposed to be in here, try
again.\n"; exit;
}
else
{
$linkID = @mysql_connect("localhost", "username", "password");
etc....
}


Prehaps you should try

if (!isset($_SERVER['PHP_AUTH_USER']))

Your php.ini file may have register_globals set to off. A good thing
BTW.
Matt

--
Quispiam Power Computing | "There are two major products that come out
Pendle Hill, Australia | of Berkeley: LSD and UNIX. We don't believe
+61 2 9631 7719 | this to be a coincidence. "
www.quispiam.com | - Jeremy S. Anderson
Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bob Everland | last post by:
I have an application that is ISAPI and the only way to secure it is through NT permissions. I need to have a way to login to windows authentication so that when I get to the ISAPI application no...
6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
4
by: David Moore | last post by:
Hello I am using the System.DirectoryServices namespace classes to access Active Directory. We connect using the LDAP://DOMAIN method. The code works on local dev boxes, and in staging, but...
8
by: tcg_gilbert | last post by:
I'm developing a web application for our local intranet that will allow users to pull up a webpage and update or deleted or insert records into a database as well as run reports etc... Our DB...
4
by: Andrew | last post by:
Hey all, I would like to preface my question by stating I am still learning ASP.net and while I am confident in the basics and foundation, the more advanced stuff is still a challenge. Ok....
3
by: Stephanie Stowe | last post by:
I am new to ASP.NET having come from ASP classic background. I need to understand authentication. I have a server running IIS which contains an ASP.NET app. On IIS the app has both anonymous and...
6
by: Ming Zhang | last post by:
Hi guys, I have couple of ASP.NET applications that only support digest windows authentication, and credentials are managed in a central AD. When users login to one app, they can easily navigate...
2
by: Bruce Groen | last post by:
I am having some authentication issues. I download a sample app to test the forms based authentication process of asp.net and it works on one of my servers but not the other one. The one that it...
10
by: Hriday | last post by:
Hi there, Please help me..It is urgent This is Hriday, working on windows authentication with Active Directory... My requirment is when a user sends a request to my web Applicatoin I want to...
5
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.