Code for admin password to be changed from front end

Hi all,

I’m new to php and trying to learn it by testing things around. I’m working on a CMS for that admin login details are stored in config.php and by default there is no option to change admin password from front end.
So I want to store admin password in database and create a page within admin area to change password.

Please assist me on this

[php]*/
?>

<? // admin constants define("ADMIN_LOGIN","admin"); // username of administrator to login define("ADMIN_PASSWORD","admin"); // password of administrator to login // admin e-mail define("ADMIN_NAME","Admin"); // username of administrator to login define("SITE_NAME",""); define("SUPPORT_EMAIL",""); define("DOMAIN","");[/php]

I’d suggest splitting this up into smaller tasks so it’s easier to see how to approach it.

ex:

[ol][li]Create an user / admin table in the database[/li]
[li]Add a user (through command line or phpmyadmin)[/li]
[li]Change your login functionality from using ADMIN_LOGIN / ADMIN_PASSWORD to a db query and authenticate the admin with the db[/li]
[li]Change the registration form to save to database (if you have one)[/li]
[li]Change the login and registration functionality to hash the password using password_hash[/li]
[li]Add a form to change the password, which posts to[/li]
[li]Create the functionality to change the password[/li]
[li][/li][/ol]

[hr]

Please use <?php instead of just the short tag <?

Sponsor our Newsletter | Privacy Policy | Terms of Service