Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to delete a token when cancel is clicked
    primarykey
    data
    text
    <p>how can i get a token that a user has requested if he/she clicks cancel NOTE the user doesnt have to input anything if cancel is clicked that particular token is deleted from the d.b and the user is redirected to index.php i really dont know where and how to start so bear with me thanks anyway below is the token.php</p> <pre><code>&lt;?php error_reporting(0); session_start(); $token=$_GET['token']; include("settings.php"); connect(); if(isset ($_POST['submit'])){ $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>and below is the formreset.php</p> <pre><code>&lt;h3&gt;&lt;strong&gt;Forgot Password&lt;/strong&gt;&lt;/h3&gt; &lt;form name="forgot" method="POST" id="forgot" action="includes/reset.php?token=&lt;?php echo $_GET['token']; ?&gt;"&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;span id="sprypassword1"&gt; &lt;label for="password2"&gt;&lt;/label&gt; &lt;br /&gt; &lt;input type="password" name="password" id="password2" /&gt; &lt;br /&gt; &lt;span class="passwordRequiredMsg"&gt;Your PASSWORD is need&lt;/span&gt;&lt;/span&gt; &lt;label for="label"&gt;&lt;/label&gt; &lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="22"&gt;&lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;strong&gt;Confirm 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;span id="spryconfirm1"&gt; &lt;label for="password1"&gt;&lt;/label&gt; &lt;br /&gt; &lt;input type="password" name="password1" id="password1" /&gt; &lt;br /&gt; &lt;span class="confirmRequiredMsg"&gt;Please re-confirm your PASSWORD&lt;/span&gt;&lt;span class="confirmInvalidMsg"&gt;The PASSWORDS don't match.&lt;/span&gt;&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="372" border="0"&gt; &lt;tr&gt; &lt;th width="132" scope="row"&gt;&lt;input type="submit" name="submit" id="submit" value="submit" /&gt;&lt;/th&gt; &lt;th width="113" scope="row"&gt;&lt;a href="includes/cancel.php?token=&lt;?php echo $_GET['token']; ?&gt;"&gt;Cancel&lt;/a&gt;&lt;/td&gt;&lt;/th&gt; &lt;th width="113" 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;thanks in advance &lt;/form&gt; </code></pre> <p>so how do i go about this</p>
    singulars
    1. This table or related slice is empty.
    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