<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC4%2FUser-Password-Change-Part-3%2FEnglish</id>
		<title>PHP-and-MySQL/C4/User-Password-Change-Part-3/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC4%2FUser-Password-Change-Part-3%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C4/User-Password-Change-Part-3/English&amp;action=history"/>
		<updated>2026-05-15T12:30:51Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C4/User-Password-Change-Part-3/English&amp;diff=914&amp;oldid=prev</id>
		<title>Pravin1389: moved PHP-and-MySQL/C4/User-Password-Change-Part-3 /English to PHP-and-MySQL/C4/User-Password-Change-Part-3/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C4/User-Password-Change-Part-3/English&amp;diff=914&amp;oldid=prev"/>
				<updated>2012-12-01T16:06:44Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/index.php/PHP-and-MySQL/C4/User-Password-Change-Part-3_/English&quot; class=&quot;mw-redirect&quot; title=&quot;PHP-and-MySQL/C4/User-Password-Change-Part-3 /English&quot;&gt;PHP-and-MySQL/C4/User-Password-Change-Part-3 /English&lt;/a&gt; to &lt;a href=&quot;/index.php/PHP-and-MySQL/C4/User-Password-Change-Part-3/English&quot; title=&quot;PHP-and-MySQL/C4/User-Password-Change-Part-3/English&quot;&gt;PHP-and-MySQL/C4/User-Password-Change-Part-3/English&lt;/a&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 16:06, 1 December 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pravin1389</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C4/User-Password-Change-Part-3/English&amp;diff=611&amp;oldid=prev</id>
		<title>Chandrika: Created page with '{| border=1 !Time !Narration |- |0:03 |This is the 3rd part of my “change password” tutorial. In this part, we’re going to change the password in the database. |- |0:11 |We…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C4/User-Password-Change-Part-3/English&amp;diff=611&amp;oldid=prev"/>
				<updated>2012-11-29T07:12:02Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;{| border=1 !Time !Narration |- |0:03 |This is the 3rd part of my “change password” tutorial. In this part, we’re going to change the password in the database. |- |0:11 |We…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| border=1&lt;br /&gt;
!Time&lt;br /&gt;
!Narration&lt;br /&gt;
|-&lt;br /&gt;
|0:03&lt;br /&gt;
|This is the 3rd part of my “change password” tutorial. In this part, we’re going to change the password in the database.&lt;br /&gt;
|-&lt;br /&gt;
|0:11&lt;br /&gt;
|We’ve already connected to our database up here. &lt;br /&gt;
|-&lt;br /&gt;
|0:14 &lt;br /&gt;
|We’re already connected here so there’s no need to reconnect, since that command has already been reissued.&lt;br /&gt;
|-&lt;br /&gt;
|0:23&lt;br /&gt;
|I’ll create a new query called “query change” and that will be equal to “mysql query&amp;quot; function.&lt;br /&gt;
|-&lt;br /&gt;
|0:30&lt;br /&gt;
|Now, this is a new bit of code.  So I will scroll down so that you can see it easily.&lt;br /&gt;
|-&lt;br /&gt;
|0:36&lt;br /&gt;
|This is “UPDATE”.  So I’m going to say “UPDATE users” - which, you can see is our table - so to update our &amp;quot;users&amp;quot; table.&lt;br /&gt;
|-&lt;br /&gt;
|0:44&lt;br /&gt;
|I will say “SET password equal to new password” &lt;br /&gt;
|-&lt;br /&gt;
|0:51&lt;br /&gt;
|making sure I use inverted commas here.&lt;br /&gt;
|-&lt;br /&gt;
|0:56&lt;br /&gt;
|Then I’ll say WHERE username is equal to the &amp;quot;user&amp;quot; variable that I’ve got on my page currently.&lt;br /&gt;
|-&lt;br /&gt;
|1:03&lt;br /&gt;
|Now this equates &lt;br /&gt;
|-&lt;br /&gt;
|1:07&lt;br /&gt;
|to what we have in this column here.&lt;br /&gt;
|-&lt;br /&gt;
|1:12&lt;br /&gt;
|So since we’ve already processed our php session, &lt;br /&gt;
|-&lt;br /&gt;
|1:18 &lt;br /&gt;
|that is equal to &amp;quot;Alex&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|1:21&lt;br /&gt;
|This piece of code is basically  saying  “update the table, change the password to the new password entered by the user. – this is the password they want.&lt;br /&gt;
|-&lt;br /&gt;
|1:32&lt;br /&gt;
|and change this “where” to Alex, &lt;br /&gt;
|-&lt;br /&gt;
|1:37&lt;br /&gt;
|as this is equal to Alex.&lt;br /&gt;
|-&lt;br /&gt;
|1:40&lt;br /&gt;
|So, this password will be changed because this username is equal to Alex.&lt;br /&gt;
|-&lt;br /&gt;
|1:45&lt;br /&gt;
|So this starts with 900 and as soon as we change it, we can refresh this and check that it actually has been changed.&lt;br /&gt;
|-&lt;br /&gt;
|1:56&lt;br /&gt;
|So I’ll just add a few more things&lt;br /&gt;
|-&lt;br /&gt;
|2:03&lt;br /&gt;
|Let’s just put this back up here.&lt;br /&gt;
|-&lt;br /&gt;
|2:06&lt;br /&gt;
|And I’ll kill the page and say “die” and then say “Your password has been changed”. &lt;br /&gt;
|-&lt;br /&gt;
|2:15&lt;br /&gt;
|Then I’ll put a link in saying “return” and that’s going to return to the main page.&lt;br /&gt;
|-&lt;br /&gt;
|2:23&lt;br /&gt;
|And that is “index.php”. &lt;br /&gt;
|-&lt;br /&gt;
|2:27&lt;br /&gt;
|Before we kill the page, I’m going to destroy the session.&lt;br /&gt;
|-&lt;br /&gt;
|2:31&lt;br /&gt;
|So “session destroy”. &lt;br /&gt;
|-&lt;br /&gt;
|2:33&lt;br /&gt;
|The reason being, once the user has changed their password, this link will take them back to the main page, and this will destroy the session. &lt;br /&gt;
|-&lt;br /&gt;
|2:42&lt;br /&gt;
|So they’ll need to login again using the new password.&lt;br /&gt;
|-&lt;br /&gt;
|2:59&lt;br /&gt;
|So if we test this, remember in here, my current password is &amp;quot;abc&amp;quot; whose md5 hash starts with 900.&lt;br /&gt;
|-&lt;br /&gt;
|3:00&lt;br /&gt;
|And if I go back here, write my old password- &amp;quot;abc&amp;quot;, my new password &amp;quot;123&amp;quot; and click “change password”. , we see that all the validation has been checked, our password has been changed,, and we get this message to return back to the main page.&lt;br /&gt;
|-&lt;br /&gt;
|3:18&lt;br /&gt;
|Now if I try to go back to the member page, you will see that you must be logged in. Our session has been destroyed, as we used our “session destroy” function here. &lt;br /&gt;
|-&lt;br /&gt;
|3:32&lt;br /&gt;
|And also, when I login again and type &amp;quot;abc&amp;quot; as my password which is my old password, we get an “Incorrect password” message.&lt;br /&gt;
|-&lt;br /&gt;
|3:43&lt;br /&gt;
|If I try &amp;quot;123&amp;quot;, you’re in, and evidence of this is shown in here.&lt;br /&gt;
|-&lt;br /&gt;
|3:50&lt;br /&gt;
|Let’s just go back and click “browse”.  Lets scroll down and we can see that the password has been changed from 900 to 202. &lt;br /&gt;
|-&lt;br /&gt;
|3:59&lt;br /&gt;
|Therefore this is a completely new hash and a completely new password.&lt;br /&gt;
|-&lt;br /&gt;
|4:06&lt;br /&gt;
|So everything’s working fine. You can see that it is quite simple to do this. &lt;br /&gt;
|-&lt;br /&gt;
|4:11&lt;br /&gt;
|All you need to do is learn your &amp;quot;sql&amp;quot; queries properly.  I have tutorials on that, too.&lt;br /&gt;
|-&lt;br /&gt;
|4:18&lt;br /&gt;
|And you need to think logically about how to check your old password, and your two new passwords,&lt;br /&gt;
|-&lt;br /&gt;
|4:24&lt;br /&gt;
|Obviously when we did our registration, we had a limit for how big the password should be. &lt;br /&gt;
|-&lt;br /&gt;
|4:31&lt;br /&gt;
|I’ll leave that to you to enter another check to see if the password should be bigger than 6 characters or no bigger than 25 characters.&lt;br /&gt;
|-&lt;br /&gt;
|4:42&lt;br /&gt;
|So really there are a lot of checks you can do, but this is the basic skeleton for changing the password in php using a mysql database. &lt;br /&gt;
|-&lt;br /&gt;
|4:53&lt;br /&gt;
|Hope you enjoyed this. If you have any comments or questions please let me know. Also subscribe to video updates. &lt;br /&gt;
|-&lt;br /&gt;
|5:01&lt;br /&gt;
|Thanks for watching! This is Harini dubbing for the Spoken Tutorial Project.&lt;br /&gt;
|-&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>