Note that there are some explanatory texts on larger screens.

plurals
  1. POphp not updating password nor token in the d.b
    primarykey
    data
    text
    <p>My forgot password is not updating the token table nor is it updating the password when changes it keeps echoing the error message below is the form code:</p> <pre><code>Forgot Password&lt;/strong&gt;&lt;/h3&gt; &lt;form name="forgot" method="POST" id="forgot" action="includes/reset.php"&gt; &lt;div align="center"&gt; &lt;table width="372" border="0"&gt; &lt;tr&gt; &lt;td width="181"&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td width="181"&gt;&lt;span id="sprytextfield1"&gt;&lt;br /&gt; &lt;label for="label"&gt;&lt;/label&gt; &lt;input type="password" name="passsowrd" id="password" /&gt; &lt;span class="textfieldRequiredMsg"&gt;Your password is required&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Confenter code hereirm Password&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt; &lt;td&gt;&lt;span id="spryconfirm2"&gt; &lt;label for="password"&gt;&lt;/label&gt; &lt;input type="password" name="password2" id="password" /&gt; &lt;span class="confirmRequiredMsg"&gt;A value is required.&lt;/span&gt;&lt;span class="confirmInvalidMsg"&gt;The values don't match.&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;div align="center"&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;table width="98" border="0"&gt; &lt;tr&gt; &lt;th width="44" scope="row"&gt;&lt;input type="submit" name="submit" id="submit" value="submit" /&gt;&lt;/th&gt; &lt;th width="44" scope="row"&gt;&lt;input type="reset" name="clear" id="clear" value="Clear" /&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;div align="center"&gt; &lt;table width="372" border="0"&gt; &lt;tr&gt; &lt;/tr&gt; &lt;tr&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>and the reset.php is:</p> <pre><code>&lt;?php session_start(); error_reporting(0); $token=$_GET['token']; include("settings.php"); connect(); if(!isset($_POST['password'])){ $q="select email from tokens where token='".$token."' and used=0"; $r=mysql_query($q); while($row=mysql_fetch_array($r)) { $email=$row['email']; } If ($email!=''){ $_SESSION['email']=$email; } else die("Invalid link or Password already changed &lt;a href='../index.php'&gt;Click here to go back to the HOME PAGE&lt;a/&gt;");} $pass=$_POST['password']; $email=$_SESSION['email']; if(isset($_POST['password'])&amp;&amp;isset($_SESSION['email'])) { $q="update registration set password='".md5($pass)."' where email='".$email."'"; $r=mysql_query($q); if($r)mysql_query("update tokens set used=1 where token='".$token."'");echo "Your password is changed successfully &lt;a href='../index.php'&gt;Click here to go back to the HOME PAGE&lt;a/&gt;"; if(!$r)echo "An error occurred"; } </code></pre> <p>so the issue is the following error message is echoed all the time: Invalid link or Password already changed.</p> <p>what should i do also if i add:</p> <pre><code>if(!isset($pass)){ echo '&lt;form method="post"&gt; enter your new password:&lt;input type="password" name="password" /&gt; &lt;input type="submit" value="Change Password"&gt; &lt;/form&gt; ';} </code></pre> <p>then it works but opens it in new blank page which is un professional thats y am trying to add it to the html</p>
    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.
    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