Jump to content

[SOLVED] can you see anything wrong


Reaper0167

Recommended Posts

no matter what info I enter in the text field.. i get the error of incorrect info.
<?php
include "connection.php";

$code = mysql_real_escape_string($_POST['code']);
$newpass = md5($_POST['newpass']);

$deliver = "SELECT id FROM members WHERE pass_auth = '$code' LIMIT 1";
$ice = mysql_query($deliver);
$fire = mysql_num_rows($ice);
$dippy = mysql_fetch_assoc($ice);
$frosty = $dippy['id'];

if($fire == 1)
{
   $sql = "UPDATE members SET password = '$newpass' WHERE id = '$frosty'";
   if(mysql_query($sql))
   {
     //confirmation of password reset
   }
   else
   {
     //system down, please try again later
   }
}
else
{
   //incorrect information. please check your form.
}
mysql_close();
?>

Link to comment
Share on other sites

Well if you are always getting the incorrect info area that means that your variable $fire does not equal 1.  I suggest outputting your variables along the line to see what is happening.

 

For example before your if statement add

 

echo "fire is $fire<br>";

 

This will atleast tell you the value and give you an idea of what might be wrong.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.