Jump to content

php login


pyr

Recommended Posts

I have a script which use the following php code to login - code is before administration code:

<?php

 

include('config.php');

 

if(!isset($_SERVER['PHP_AUTH_USER']) or strcmp($_SERVER['PHP_AUTH_USER'],$login) or strcmp($_SERVER['PHP_AUTH_PW'],$password)) {

    header("WWW-Authenticate: Basic realm=Secured area");

    header("HTTP/1.0 401 Unauthorized");

    die("No entry. Goodbye!");

}

else {

    //

}

?>

 

in cofig.php I have:

$login = "admin";$password = "admin";

 

But when my provider changed php 4 to 5, i cannot login into administration anymore. Can you please check the code. Thanks.

Link to comment
https://forums.phpfreaks.com/topic/68468-php-login/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.