Can someone help this newbie with something that appears (to me) to be simple?
I have a page that displays nothing but an “enter password” form which requires the user to enter the default password to gain access to the page. The PHP code in this page checks to see if a certain file exists which contains the password. If the file does not exist, the “password.php” file is created and the following is added to the newly created file:
[code=php]<?php $pwrd = “sdf4256df56sdf56df56f6sf”?>
The line above is the md5 default password. Basically, if the user is using this page for the first time, he would enter the default password and the password file would be created. Once the user has entered the correct default password, the user then has access to the page.
The reason I am posting here is because I want to add some simple code that will check to see if the “password.php” file exists and if it contains the md5 default password. If it does, I want a warning to be displayed (where ever I choose to place it on the page) which tells the user he needs to change the default password.
Here is the mock up, I just don’t know how to code:
<?php
if file “./password.php” exists and “$pwrd” is equal to “sdf4256df56sdf56df56f6sf”
{
Then display warning “<div>blah, blah</div>”
}
Else do nothing
?>
Any help would be appreciated?