Oliver Angelil
Oliver Angelil

Reputation: 1284

Password protecting a webpage with PHP

I've tried to password protect my website with Tom's answer here. I have copied his access.php script only changing the 5th line to:

$password = 'hello';

I've then created another file ('test.php') in the same directory on the server, and added the following to it:

<?php
require('access.php');
?>
secret text

However when I type in 'hello' on my site, it tells me my password is incorrect. Is there something about the way the server has been setup that would not allow this? Although I have tried this on two different servers that have both been setup for html and php, and in both cases my password is not accepted.

Upvotes: 1

Views: 2297

Answers (1)

You can't change the 5th line to "hello" cause the provided code aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d already means "hello" after the sha1 process of encripting security. Or: maintain the code provided and you will see "hello" working.

Upvotes: 5

Related Questions