Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4274108
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:48:10+00:00 2026-05-21T07:48:10+00:00

Dear folks, There seems to be a problem with password protection for accessing a

  • 0

Dear folks,
There seems to be a problem with password protection for accessing a particular php page:
@ When I embed this test code, I am presented nicely with a popup authentification dialog.
@ If I fill in the fields and press enter, it does not show the password/login on the page!
@ It just presents me again the auth dialog with emptied fields… again and again
@ After 3 tries orso it sais unauthorised to access…

What could be going on? Thanks very much for your suggestions!

if (!isset($_SERVER['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>";
}

Ive Apache 2.0x Fedora with PHP 5.2.3 and nowhere else is password set in apache htacces or anything

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:48:11+00:00Added an answer on May 21, 2026 at 7:48 am

    PHP_AUTH_USER is available for mod_php setups at best. For CGI or FastCGI setups you will have to manually unmarshall the HTTP_AUTHORIZATION header. To make matters worse, it is often not present for security reasons. ( Basic Authentication with PHP gives an endless loop )

    You will have to check with phpinfo() which variant you can use. Then apply one of the more complex examples from the comments in http://www.php.net/manual/en/features.http-auth.php#94349

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear folks, Currently a rewrite should redirect /index.php to /en/home And for that this
Dear folks, Imagine a One Page Site RewriteCond %{HTTP_HOST} ^1pagesite.org$ RewriteRule ^$ 1pagesite.php [L]
Dear stackoveflow, I have this problem. I'm working with an old version of mssql
dear all..i have this code: <script> var str=KD-R435MUN2D; var matches=str.match(/(EE|[EJU]).*(D)/i); if (matches) { var
Dear Friends good afternoon. My problem may be this is very basic one i.e.
Dear friends,I want to extract text 平均3.6 星 from this code segment excerpted from
Dear folks, Closure Compiler gives this warnings in Advanced Mode, underlining {this. JSC_USED_GLOBAL_THIS: dangerous
Dear folks, The (www.)? part in the below code doesnt work properly I feel:
Dear all, I have a question about Facebook Page: ( NOT user profile page,
Dear all,Now i have this question in my java program,I think it should be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.