<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (9)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

Resources


 USdigitalcable.com

Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Lost password to website siteadmin (1 viewing) (1) Guest
Post your PHP related questions or observations here. Code snippets are always welcome.
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Lost password to website siteadmin
#579
Dewed (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Lost password to website siteadmin 3 Years, 4 Months ago Karma: 9  
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.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/10/02 16:19 By Dewed.
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
      Topics Author Date
    thread link
Lost password to website siteadmin
upalmit 2008/10/02 06:38
    thread link
thread linkthread link Re:Lost password to website siteadmin
Dewed 2008/10/02 16:16
Go to top Post Reply
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008