Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Function Error not Updating Password but receiving ok message
    primarykey
    data
    text
    <p>I am trying to change the password from the user logged in. On the page it says the password was changed, but it does not change, not on the database and not at all. I have trying logging in with the new password, but just the old one remains to login. I did refreshed the page and everything. I am trying this for a couple of days and I wonder if someone would kindly spot my error. Tonight I thought it could be because the password is encrypted with md5 on the database. How would I proceed as I already tried a few things and do not work.</p> <pre><code>error_reporting(E_ALL); ini_set("display_errors","On"); &lt;?php include "includes/connection.php" ?&gt; &lt;?php session_start(); if(@$_REQUEST["Submit"]=="Update") { $sql="update users set password ='$_REQUEST[newpassword]' where user='$_SESSION[myusername]'"; if (!mysql_query($sql)) die('err: PROBLEM IN QUERY: '.mysql_error()); header("Location:changpass.php?msg=updated"); } else die('err: PROBLEM IN REQUEST'); ?&gt; &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt; &lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Change password&lt;/TITLE&gt; &lt;script language="javascript" type="text/javascript"&gt; function validate() { var formName=document.frm; if(formName.newpassword.value == "") { document.getElementById("newpassword_label").innerHTML='Please Enter New Password'; formName.newpassword.focus(); return false; } else { document.getElementById("newpassword_label").innerHTML=''; } if(formName.cpassword.value == "") { document.getElementById("cpassword_label").innerHTML='Enter ConfirmPassword'; formName.cpassword.focus(); return false; } else { document.getElementById("cpassword_label").innerHTML=''; } if(formName.newpassword.value != formName.cpassword.value) { document.getElementById("cpassword_label").innerHTML='Passwords Missmatch'; formName.cpassword.focus() return false; } else { document.getElementById("cpassword_label").innerHTML=''; } } &lt;/script&gt; &lt;style type="text/css"&gt; &lt;!-- .style1 {font-weight: bold} .style7 { color: yellow; font-size: 24px; } .style9 { color: #FF6666; font-weight: bold; } .style12 { color: #666666; font-weight: bold; } .style14 {color: #CC0033; font-weight: bold; } --&gt; &lt;/style&gt; &lt;META http-equiv=Content-Type content="text/html; charset=windows-1252"&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;form action="changpass.php" method="post" name="frm" id="frm" onSubmit="return validate();"&gt; &lt;table width="47%" border="1" cellspacing="0" cellpadding="0"&gt; &lt;tr&gt; &lt;td colspan="2" align="center"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr bgcolor="#666666"&gt; &lt;td colspan="2"&gt;&lt;span class="style7"&gt;Change Password&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php if(isset($_REQUEST['msg']) &amp;&amp; $_REQUEST['msg'] == 'updated') { ?&gt; &lt;tr bgcolor="#666666"&gt; &lt;td colspan="2"&gt;&lt;span class="style7"&gt;Password has been changed successfully.&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; &lt;tr&gt; &lt;td bgcolor="#CCCCCC"&gt;&lt;span class="style14"&gt;New Password:&lt;/span&gt;&lt;/td&gt; &lt;td bgcolor="#CCCCCC"&gt;&lt;input type="password" name="newpassword" id="newpassword" size="20" autocomplete="off"/&gt;&amp;nbsp; &lt;label id="newpassword_label" class="level_msg"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td bgcolor="#CCCCCC"&gt;&lt;span class="style14"&gt;Confirm Password:&lt;/span&gt;&lt;/td&gt; &lt;td bgcolor="#CCCCCC"&gt;&lt;input type="password" name="cpassword" id="cpassword" size="20" autocomplete="off"&gt;&amp;nbsp; &lt;label id="cpassword_label" class="level_msg"&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr bgcolor="#666666"&gt;&lt;td colspan="2" align="center"&gt;&lt;input type="submit" name="Submit" value="Update" /&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/table&gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/form&gt;&lt;/BODY&gt;&lt;/HTML&gt;` </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload