HELLO ! THANX FOR YOUR TUTORIALS . THESE WERE VERY HELPFUL FOR ME.. BUT AFTER I FOUND ALL , I COULDN'T GO RIGHT WITH CHANGE PASSWORD TUTORIAL. THERE IS AN ERROR COMING ON MY SCREEN .. YOU PLEASE CHECK IT OUT... Fatal error: Function name must be a string in C:\xampp\htdocs\changepassword.php on line 195 PLEASE TELL ME WAT IS THE PROBLEM<?php@$username = $_SESSION['username'];@$submit=$_POST['submit'];if ($username){ if('submit') { @$oldpassword =md5($_POST['oldpassword']); @$newpassword =md5($_POST['newpassword']); @$repassword =md5($_POST['repassword']); $connect = mysql_connect("localhost","root",""); mysql_select_db("userlogin") or die(); $queryget = mysql_query("SELECT password FROM users WHERE username='$username'") or die("couldn't connect!"); $row = mysql_fetch_assoc($queryget); $oldpassworddb = $row['password']; if($oldpassword==$oldpassworddb) { if($newpassword==$repassword) { $querychange =mysql_query("UPDATE users SET password='$newpassword' WHERE username='$username'"); die("Your password has been changed. <a href='mbkpage.php'>Return</a> back to main page"); } else die ("New Passwords Do Not Match"); } ELSE die ("Old Passwords doesnt match"); } else { echo"<form action='changepassword.php' method='POST'> Old Password: <input type='text' name='oldpassword'><p> New Password: <input type='password' name='newpassword'><br> Repeat New Password: <input type='password' name='repassword'><p> <input type='submit' name='submit' value='Change Password'> </form> "; } } else die ("you must be logged in");?>
1064 visits
Outline:User Password Change Part 3 updating the new password in database. mysql_query('TYPE_HERE_YOUR_MYSQL_QUERY') - It is used to run specific queries on our database. Here it updates new password into database.
User Password Change Part 3 updating the new password in database. mysql_query('TYPE_HERE_YOUR_MYSQL_QUERY') - It is used to run specific queries on our database. Here it updates new password into database.
Show video info
Pre-requisite