Jump to content

PhilTilson

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

PhilTilson's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [quote]post a link to your PHP info file on your ISP server. So I can see what PHP is running as![/quote] Check out [url=http://www.tptp.co.uk/checkphp.php]http://www.tptp.co.uk/checkphp.php[/url] - could it be something to do with the fact that my local installation is running the Apache 2.0 handler as the server API while my ISP is running CGI? Phil
  2. Sorry - fairly new to this.  Thought I'd caught that one, but didn't realise that the <!DOCTYPE...> line sent output to the browser! I now get the login box but it refuses to accept any of the username/password pairs I have in the array.  Again, this works fine on my localhost. Can you solve this one too?! Phil
  3. Hi - have a problem with some simple login code that works fine when I run it on my localhost server, but fails when I upload it to my ISP's server.  (Please don't criticise the very basic security - there's a reason!).  Code is as follows: [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <?php //An array of allowed users and their passwords include 'UserDtls.php'; //If there's no authentication header, exit if (!isset($_SERVER['PHP_AUTH_USER'])) { header('HTTP/1.1 401 Unauthorized'); header('WWW-Authenticate: Basic realm="CCPAdmin"'); exit('This page requires authentication'); } //If the username doesn't exist, exit if(!isset($users[$_SERVER['PHP_AUTH_USER']])) { header('HTTP/1.1 401 Unauthorised'); header('WWW-Authenticate: Basic realm="CCPAdmin"'); exit('You are not authorised to view this page!'); } //If the password doesn't match correctly, exit if($users[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW']) { header('HTTP/1.1 401 Unauthorised'); header('WWW-Authenticate: Basic realm="CCPAdmin"'); exit('You are not authorised to view this page!'); } ?> [/code] On localhost, everything works perfectly; on ISP server, I always get the first error message - "This page requires authentication". I've checked the sticky on HEADERS etc but I don't think that's it.  Any ideas, please?  The [b]include[/b] file is just an array declaration with username/password pairs - but I don't get that far! Phil
×
×
  • 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.