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
https://forums.phpfreaks.com/topic/164586-solved-can-you-see-anything-wrong/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.