[SOLVED] Independent Change password script

This is guide mostly for website tools and code, for example CMS or registration scripts.
There can also be tools.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[SOLVED] Independent Change password script

Postby Eterdaz on Thu May 14, 2015 5:09 am

I want to make change password php script. the format :

Username:
Current Password:
New Password:
Repeat New Password:

[Change Password] <<< button for change the password

and this script must include mysql connect script. can someone help me to make it, please ?
Last edited by Eterdaz on Sun Nov 22, 2015 7:37 am, edited 1 time in total.
Eterdaz
Jelly Bean
Jelly Bean
 
Posts: 19
Joined: Fri Jul 18, 2014 1:40 pm

Re: [REQUEST] Independent Change password script

Postby PurpleYouko on Thu May 14, 2015 4:20 pm

Seems simple enough.

It will require at least 3 files to work best.

1) HTML form page with embedded JavaScript (AJAX code) for comparing the new passwords and for passing the details through to a...

2) PHP code page which will actually load in the database entry to confirm old password then save the new one then return a message back to innerhtml on the first page

3) stand alone PHP connection details page which can be "required" in any other PHP code that needs to connect to the database

Would you want it to be inside an existing website or a stand alone utility?
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: [REQUEST] Independent Change password script

Postby Eterdaz on Thu May 14, 2015 5:13 pm

I want a stand alone utility. so the script work like if we input the correct username and current password match with the database then we can change the password. if don't , we can't change the password, so this script no need to log in first before change the password.
Eterdaz
Jelly Bean
Jelly Bean
 
Posts: 19
Joined: Fri Jul 18, 2014 1:40 pm

Re: [REQUEST] Independent Change password script

Postby PurpleYouko on Thu May 14, 2015 5:42 pm

This should do it

Password_changer.zip
(3.53 KiB) Downloaded 652 times


It came out as 4 files actually. Could have been condensed to 2 but it's more expandable this way.
I threw together some slightly modified code that I've used before and wrote a little bit extra to compare passwords and stuff.

Just put your database details into "dbconnect.php" and put the whole folder on your website.
The actual code that does all the real work is in js.htm and passwordchangecode.php.
I put in a couple of checks for you. the new PW must be different than the old one and the two new ones must match. Also added a minimum length of 5 characters
You can add as many rules in there as you like. PHP is pretty easy to work with.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: [REQUEST] Independent Change password script

Postby Eterdaz on Fri May 15, 2015 4:21 am

when i tried the script, i found this error. how to fix it ?

Picture2.jpg
Eterdaz
Jelly Bean
Jelly Bean
 
Posts: 19
Joined: Fri Jul 18, 2014 1:40 pm

Re: [REQUEST] Independent Change password script

Postby PurpleYouko on Fri May 15, 2015 6:40 pm

well it looks like you already have a page which is calling the function.

I thought you wanted a stand alone utility. The page shown there is "index.php/change-game-password". It doesn't even show an extension. You need to be in passwordchange.php for it to work. The right side of the picture does indeed look like the format of my utility but what is it doing inside another page?
Did you embed my code into index.php or something?

My utility was designed to be a free standing section. You can link into it from outside and yo can set the return link to go back to any url you like but embedding it is gonna cause problems most likely

where did you place the four files? They all need to be in the same folder.

How are you linking to passwordchange.php (if you are doing so at all. From the picture it doesn't look like you are)

When doe this error occur and what is the URL of the page it can't find?

The only way to get that error message returned into the innerhtml return point is if the javascript is calling passwordchangecode.php and can't find it in the same folder as the code is running.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: [SOLVED] Independent Change password script

Postby Eterdaz on Sat May 16, 2015 4:11 am

I'm using a cms. i already try again with direct link and it's work. thanks for the help. :D

Picture2.jpg
Eterdaz
Jelly Bean
Jelly Bean
 
Posts: 19
Joined: Fri Jul 18, 2014 1:40 pm


Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 6 guests

cron