Retrieving the current password is likely not possible, but changing it probably is.
There are 3 basic ways to password protect a portion of a PHP script. Since you can apparently use FTP to browse the files that make up this site, that gives you two methods to change that password.
First method, htaccess.
Look for a file named .htaccess in the protected directory. Temporarily renaming it may allow you to get to the page you want without a password prompt at all. Viewing the contents of the file would at least tell you the user name portion. Your web hosts control panel likely has a link that allows you to re-password protect teh directory with a password of your choosing.
Second method, username and password stored in a configiration file.
Look for a file with a name like config.php, configure.php, settings.php or possible database.php or something similar. Possibly you'll see something like
$admin_user_name = 'admin';
$admin_password = 'adminpassword';
of course it could be anything, but you can edit the php file with a plain text editor like notepad, change the password to something else and upload the edited file back to where it was.
Third method, user name and password stored in a MySQL database.
If you can login to your web host's site control panel, it's likely they have a link to something called PHPMyAdmin there. That will let you browse the databases connected to your site.
Inside databases, are tables, and tables store the actual data. Again the table name with the admin login info may be called anything, configuration, config, settings etc.
If you can locate the table row that contains the admin user name and password, you likely will only see an encrypted password, but you can edit the record, and remove the data from the password field entrirely. (probably best to copy and paste the encrypted password into notepad, in case you need to put it back.)
Possibly you can just enter a plain text password, or leave the password field blank.
If you can login, look for a change admin password function and set it to something you can remember.
If the script won't allow a login with blank, or an unencrypted password, then you will need to set the password manually, using a mysql query. You can do that in PHPMyAddmin too.
Once you have found the database in PHPMyAdmin, select the table from the list on the left that contains the user password information. Then click the brows button.
Take note of the column names, with the data in them. Determine which row of data needs changing, and which column.
Then click the SQL link near the top.
Enter...
| Code: |
update TABLE_NAME set PASSWORD_COLUMN_NAME=password('newpassword')
WHERE USER_COLUMN_NAME='admin_user_name';
|
Of course you'll need to replace the TABLE_NAME, PASSWORD_COLUMN_NAME, USER_COLUMN_NAME and admin_user_name with the column names and user name found when browsing the table.