Jump to content

Recommended Posts

solved


Can dreamweaver make the code to send users there lost password or can someone help me with this code

this it not working i copied it from the web
i am new at PHP
i need to send user name and pswd to the user If anyone has the code for that please post

After sumitting i get this error

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in -- lost_passwordck.php on line 21

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /usr/home/destined/public_html/lost_passwordck.php on line 22

<?php
session_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 variable
if ($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 line

if(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>";}
?>
Link to comment
https://forums.phpfreaks.com/topic/8574-lostpass-word/
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.