Jump to content

recovery of lost password


destined

Recommended Posts

This was working and all i did was take Zip & Address out of the table
i think that is when this stoped working (not sure)
I dont know much PHP I let Deramweaver do that for me.. lol
it keeps saying the (echo)error that the email ady is not in DB
but it is !
Please help

[!--coloro:#000099--][span style=\"color:#000099\"][!--/coloro--]its the same if i use this[!--colorc--][/span][!--/colorc--]
<?php
$db_name = "destined_users"; //this is your database name
$db_user = "destined_XXX"; //this is your database username for the database specified above
$db_pass = "XXXX"; //this is your database password for the user specified above
$db_host = "localhost"; //this is your host for the database, best to leave it as localhost

mysql_connect("$db_host", "$db_user", "$db_pass")or die(mysql_error());
mysql_select_db("$db_name") or die(mysql_error());
?>
[!--coloro:#333399--][span style=\"color:#333399\"][!--/coloro--]Or If I Use This[!--colorc--][/span][!--/colorc--]
<?php require_once('Connections/user_login.php'); ?>
<?php
mysql_select_db($database_user_login, $user_login);
$query_rsRecover = "SELECT * FROM tbl_users";
$rsRecover = mysql_query($query_rsRecover, $user_login) or die(mysql_error());
$row_rsRecover = mysql_fetch_assoc($rsRecover);
$totalRows_rsRecover = mysql_num_rows($rsRecover);
?>
[!--coloro:#333399--][span style=\"color:#333399\"][!--/coloro--]here is the Code[!--colorc--][/span][!--/colorc--]

<?php require_once('Connections/user_login.php'); ?>
<?php
mysql_select_db($database_user_login, $user_login);
$query_rsRecover = "SELECT * FROM tbl_users";
$rsRecover = mysql_query($query_rsRecover, $user_login) or die(mysql_error());
$row_rsRecover = mysql_fetch_assoc($rsRecover);
$totalRows_rsRecover = mysql_num_rows($rsRecover);
?>
<?
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
?>

<?

if (isset($_POST['submit'])){ $query="SELECT emailaddress,username,pwd FROM tbl_users WHERE [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]emailaddress[!--colorc--][/span][!--/colorc--] = '$emailaddress'";
$st=mysql_query($query);
$recs=mysql_num_rows($st);
$row=mysql_fetch_object($st);
$em=$row->emailaddress;// email is stored to a variable
if ($recs == 0) { echo "<center><font face='Verdana' size='2' ><b>No Password</b><br> Sorry Your email address is not there in our database. You can register and login to use our members pages. <BR><BR><a href='registration.php'> Register </a> </center>"; exit;}

$headers4="password@destinedtowin.org"; ///// Change this address within quotes to your address ///

$headers .= "From: $headers4\n";
$headers .= "Errors-to: $headers4\n";
//$headers = "Content-Type: text/html; charset=iso-8859-1\n".$headers;// for html mail un-comment this line

if(mail("$em","password/user name recovery","This is in response to your request for your login information for \n Destined To Win Ministries at www.destinedtowin.org \n\n username: $row->username \n password: $row->pwd \n\n Thank You \n \n \n Please do not reply to this email","$headers")){echo "<center><font face='Verdana' size='2' ><b>THANK YOU</b> <br>Your password and user name have been sent to your emil address. <br>
Please check your mail <BR><BR><a href='login.php'> Login </a><br>
<br>
</center>";}
else{ echo " <center><font face='Verdana' size='2' >There is some system problem in sending login details to your address. Please contact site-admin. <br><br><input type='button' value='Retry' onClick='history.go(-1)'></center></font>";}


}


?>
Link to comment
Share on other sites

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]I let Deramweaver do that for me..[/quote]
There is your problem and Im afraid this forum is for people who want help with php. Not help getting a program to wirte it for them. php is a complex programming language, ddo you really expect a program to be able to create applications by itself?

Dreamweaver is the apotome of false hope for newbies.
Link to comment
Share on other sites

well my first suggestion is that you are using $emailaddress instead of $_POST['emailaddress'] in your query. please note that these are NOT the same variables. replace $emailaddress with $_POST['emailaddress'] or else put this line:

$emailaddress = $_POST['emailaddress'];

right before the query. if this doesn't help then post the code that sets $emailaddress to the email address in question, as i don't seem to see where $emailaddress is being initialized in the code above...

[!--quoteo(post=374151:date=May 15 2006, 06:26 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ May 15 2006, 06:26 PM) [snapback]374151[/snapback][/div][div class=\'quotemain\'][!--quotec--]
There is your problem and Im afraid this forum is for people who want help with php. Not help getting a program to wirte it for them. php is a complex programming language, ddo you really expect a program to be able to create applications by itself?

Dreamweaver is the apotome of false hope for newbies.
[/quote]
funny.... but if you aren't going to help then why post at all? and besides, it is not that hard at all to make a script that builds/automates another script. That's what we call functions and objects. Now whether dreamweaver is buggy or not is another subject altogether...
Link to comment
Share on other sites

ok so i might not know PHP
but the way to learn is to come here and ask
i dont let Dreamweaver do it all

Thank you Crayon Violent for trying to help
i will try what you said and no this is not a Dreamweaver code
ill be back tomorrow Thanks agian Crayon Violent
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.