jalaladdin Posted September 14, 2010 Share Posted September 14, 2010 how to write change password with php? Link to comment Share on other sites More sharing options...
Sami Posted September 14, 2010 Share Posted September 14, 2010 Change what password? Link to comment Share on other sites More sharing options...
justsomeguy Posted September 14, 2010 Share Posted September 14, 2010 how to write change password with php?Like this!echo 'change password'; Link to comment Share on other sites More sharing options...
bartje01 Posted September 14, 2010 Share Posted September 14, 2010 Lolled @ justsomeguy Link to comment Share on other sites More sharing options...
thescientist Posted September 14, 2010 Share Posted September 14, 2010 Link to comment Share on other sites More sharing options...
jalaladdin Posted September 15, 2010 Author Share Posted September 15, 2010 no i want chane password script Link to comment Share on other sites More sharing options...
jalaladdin Posted September 15, 2010 Author Share Posted September 15, 2010 i wrote this script but explorer show me this error<?php session_start();// connect to the mysql server$link = mysql_connect($server, $db_user, $db_pass)or die ("Could not connect to mysql because ".mysql_error());// select the databasemysql_select_db($database)or die ("Could not select database because ".mysql_error());$username = $_POST['username'];$password = $_POST['password'];$newpassword = $_POST['newpassword'];$confirmnewpassword = $_POST['confirmnewpassword'];$result = mysql_query("SELECT password FROM users WHERE username='$username'");if(!$result) { echo "The username you entered does not exist. "; } else if($password!= mysql_result($result, 0)) { echo "You entered an incorrect password. "; } if($newpassword=$confirmnewpassword) $sql=mysql_query("UPDATE users SET password='$newpassword' where username='$username'"); if($sql) { echo "Congratulations! You have successfully changed your password. "; }else{ echo "The new password and confirm new password fields must be the same. "; } ?> Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in /www/110mb.com/b/b/q/s/q/u/i/r/bbqsquirrelbrigade/htdocs/changepw.php on line 27 Link to comment Share on other sites More sharing options...
justsomeguy Posted September 15, 2010 Share Posted September 15, 2010 It sounds like the query didn't return any results. You can check how many records the query returned with mysql_num_rows. Link to comment Share on other sites More sharing options...
jalaladdin Posted September 16, 2010 Author Share Posted September 16, 2010 It sounds like the query didn't return any results. You can check how many records the query returned with mysql_num_rows.i need change password script Link to comment Share on other sites More sharing options...
Synook Posted September 16, 2010 Share Posted September 16, 2010 There is no such thing as a universal "change password" script (except one that prints "change password") - you need to write one that is specific to your application. If you try to follow the advice we give you in debugging your script, then eventually you should be able to get a working solution. Link to comment Share on other sites More sharing options...
Miss_Rebelx Posted September 16, 2010 Share Posted September 16, 2010 Sounds like a broken record to me.Love your answer justsomeguy!I suggest making sure your matching your field names properly, as well as table name. And echo the row count as mentioned above. Then post back with meaningful information for us to maybe try and help fix the problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.