Web Analytics Made Easy -
StatCounter php authentication not working - CodingForum

Announcement

Collapse
No announcement yet.

php authentication not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • php authentication not working

    hi ,

    I am using this code for authorization

    PHP Code:

        
    if (!isset($PHP_AUTH_USER)) {
            
    header('WWW-Authenticate: Basic realm=Northline Administration');
            
    header('HTTP/1.0 401 Unauthorized');
        echo 
    "here";
            exit;
        } else if (isset(
    $PHP_AUTH_USER)) {


        
                
                echo 
    'Authorisation Failed.  Please confirm your username and password';
                echo 
    $PHP_AUTH_USER;
            
        } 
    But i am continuously getting the login panel and not going through.
    I have removed the database checking but it should accept any name

    I have copied the file from other website which was working fine.
    I there any other setting i need to turn on to make this work?

  • #2
    http://www.sitepoint.com/article/ant...ess-control/2/ may help.
    Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

    Comment


    • #3
      I found my mistake

      I was using
      $PHP_AUTH_USER
      instead of this
      $_SERVER["PHP_AUTH_USER"];
      thanks bud

      Comment

      Working...
      X