destined Posted April 27, 2006 Share Posted April 27, 2006 solvedCan dreamweaver make the code to send users there lost password or can someone help me with this codethis it not working i copied it from the web i am new at PHPi need to send user name and pswd to the user If anyone has the code for that please postAfter sumitting i get this errorWarning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in -- lost_passwordck.php on line 21Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /usr/home/destined/public_html/lost_passwordck.php on line 22<?phpsession_start();session_register("session");?><?if (isset($_POST['submit'])){ $query="SELECT emailaddress,username,pwd FROM tbl_users WHERE tbl_users.emailaddress = '$emailaddress'";$st=mysql_query($query);[!--coloro:#CC6600--][span style=\"color:#CC6600\"][!--/coloro--]$recs=mysql_num_rows($st);$row=mysql_fetch_object($st);[!--colorc--][/span][!--/colorc--]$em=$row->emailaddress;// email is stored to a variableif ($recs == 0) { echo "<center><font face='Verdana' size='2' color=red><b>No Password</b><br> Sorry Your address is not there in our database . You can signup and login to use our site. <BR><BR><a href='signup.php'> Sign UP </a> </center>"; exit;}$headers4="admin@destinedtowin.org"; ///// Change this address within quotes to your address ///$headers.="Reply-to: $headers4\n";$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 lineif(mail("$em","Your Request for login details","This is in response to your request for login detailst at site_name \n \nLogin ID: $row->username \n Password: $row->pwd \n\n Thank You \n \n siteadmin","$headers")){echo "<center><font face='Verdana' size='2' ><b>THANK YOU</b> <br>Your password is posted to your emil address . Please check your mail after some time. </center>";}else{ echo " <center><font face='Verdana' size='2' color=red >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>";}} else {echo "<center><font face='Verdana' size='2' color=red >$msg <br><br><input type='button' value='Retry' onClick='history.go(-1)'></center></font>";}?> Quote Link to comment https://forums.phpfreaks.com/topic/8574-lostpass-word/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.