473,691 Members | 3,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Turn on $_SERVER["PHP_AUTH_U SER"] locally?

Hello,

I am finding that on a new server where I am developing

$_SERVER["PHP_AUTH_U SER"] and
$_SERVER["PHP_AUTH_P W"]

Do not show up in $_SERVER when I when they should be defined I test
using
print_r($_SERVE R) or this

<?php
if (!isset($_SERVE R['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your
password.</p>";
}
?>

Is there a setting that is keeping PHP from accessing this
information? Can I set this locally?

$_SERVER["REMOTE_USE R"] also stays empty.

TIA for any advice!

jg
Jul 17 '05 #1
1 5805
I should add that if I add an .htaccess to a folder requiring username "dm"
and password "whatever" and then

do this

<?php
echo 'PHP_AUTH_USER =' . $_SERVER['PHP_AUTH_USER'] . '<br>';
echo 'PHP_AUTH_PW =' . $_SERVER['PHP_AUTH_PW'] . '<br>';
echo 'REMOTE_USER =' . $_SERVER['REMOTE_USER'] . '<br>';
?>
I get this:

PHP_AUTH_USER =
PHP_AUTH_PW =
REMOTE_USER =dm

so REMOTE_USER is defined but no :password.

jg
Jul 17 '05 #2

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

Similar topics

3
8814
by: Aardwolf | last post by:
I've had PHP on my Win2K server running IIs 5 for about 2 weeks now. I have an annoying problem in that I can not run the php scripts/pages locally, instead they open up in the browser as a download. By that I mean that If I access them via my lan or the net from another computer on my lan, the webpages that have php on them and end in a .php extension all run fine and work just great. BUT if I open up the browser on the IIs server...
1
1989
by: Bathroom_Monkey | last post by:
Hi, I am building some php script that will backup a mysql database and store it locally. This script will be run on a spare computer I have in my office. I want the results of the backup to be displayed on the screen, through a web browser, but I ran into a small problem with this: leaving the monitor on 24/7 while displaying a text report that will often look similar may have the potential to burn an image into the monitor, and ruin...
4
1405
by: melih.onvural | last post by:
Group, I'm diving into this crazy PHP thing, and I find myself a bit stuck. Locally I can get a site to work very well. However, whenever I ask a buddy of mine to test the site and I give him my IP it doesn't work. I have a form. The form checks username/password against a database and then either sends you back to the form or forwards you to the next page. Is:
0
3137
by: Shailesh | last post by:
Metalink says that, whenever we migrate from dictionary managed to locally managed tablespaces, 'Migrated tablespaces are not subject to the UNIFORM/SYSTEM policy of newly created locally managed tablespaces. you should see "USER" value in the ALLOCATION_TYPE column for migrated tablespaces'. Oracle documentation says that parameters like INITIAL, NEXT , MINEXTENTS, MAXEXTENTS will not apply to locally managed tablespaces. Suppose I...
10
2038
by: Tobias Nilsson | last post by:
I have almost exactly the same problem as the guy below. Is it NOT possible running .NET code locally in Internet Explorer WITHOUT a webserver???? / Tobias --------- My company has in the past created local browser applications with front end in HTML/JavaScript and backend in the form of a Java applet. The applet code contained the business code and calculations. Benefit of this approach is
3
9259
by: dk | last post by:
Hi all, Would appreciate some advice on the following: I am trying to speed up an Access database connected to a SQL Server back-end. I know I can use a pass-through query to pass the sql code directly to SQL Server and speed things up. However, I want to be able to "filter" or place conditions on which records to retrieve based on LOCAL tables in Access.
5
4483
by: Eric Capps | last post by:
I'm writing a web app that uses a PHP script to request information from the server. I'd like to test it locally on my machine, but despite having PHP installed, I can't seem to get it to process the .php file automatically when it is read. Is there a way to turn automatic processing of a file/directory on/off?
2
3445
by: Bob Bruyn | last post by:
I've recently installed Apache 2 and php 5.2 on my WIndows XP machine. Everything is up and running. I'm passing some vars via the URL. It works fine online: http://www.torusdesign.nl/spry/test.php?folder=schilderijen/vrij_werk&navColor=SchilderijenNAV This is the code: <?php echo $folder; ?> <?php echo $navColor; ?>
1
3278
by: | last post by:
Hello, This is a very belated followup to the below issue, I am the original poster. I recently was creating a new OU structure and new security policy and during testing it was noticed that in fact happened on a server that has a web-app that uses Windows integrated authentication, which was a surprise to me. Does this "Log on Locally" policy also affect web-apps using Windows Integrated Authentication?
0
8599
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8531
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8791
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7623
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4322
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2227
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1952
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.