Re: Retrieving password from database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



U are using the $pass=$row[pass]; before the $row being defined.

the code should be like this
*<?php
if (!empty($_POST[Submit]))
{
include ("connect.php");
$pwquestion=$_POST[pwquestion]*

*;
$pwanswer=$_POST[pwanswer];
$cityob=$_POST[cityob];
$check=mysql_query("SELECT * FROM register WHERE pwanswer='$pwanswer' AND
cityob='$cityob'");
if(mysql_num_rows($check)==0)*

*{
echo "Invalid Check";
*

*}*

*else
{

$sel=mysql_query("SELECT * FROM register WHERE pass='$pass'");
$row=mysql_fetch_array($sel);*

*$pass=$row[pass];
echo "Your Password is <b>$pass</b>";
// The output is: Your Password is
// I need the really password($pass) to be echo out
}
}
?>*



On Wed, Jan 13, 2010 at 6:36 PM, doneatlast1000 <doneatlast1000@xxxxxxxxx>wrote:

>
>
> I write the script below for users to retrieve their password when
> forgotten, but the echo result is not brining out the password as it output:
> Your password is
>
> Can anyone look at the script below and help out.
>
> <?php
> if (!empty($_POST[Submit]))
> {
> include ("connect.php");
> $pwquestion=$_POST[pwquestion];
> $pwanswer=$_POST[pwanswer];
> $cityob=$_POST[cityob];
> $check=mysql_query("SELECT * FROM register WHERE pwanswer='$pwanswer' AND
> cityob='$cityob'");
> if(mysql_num_rows($check)==0)
> echo "Invalid Check";
> else
> {
>
> $pass=$row[pass];
> $sel=mysql_query("SELECT * FROM register WHERE pass='$pass'");
> $row=mysql_fetch_array($sel);
> echo "Your Password is <b>$pass</b>";
> // The output is: Your Password is
> // I need the really password($pass) to be echo out
> }
> }
> ?>
>
>  
>



-- 
Chaitanya

"A man can get discouraged many times but he is not a failure until he he
stops trying..."

http://doiop.com/dr.virus.india

http://www.drvirusindia.co.cc/

http://chaitu09986025424.blog.co.in/

http://9986025424.co.cc -- Live news channels


[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux