PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I made a forgot password script in this code its suppose to send out the username and password if the username and email address is matched up well it matches them up but when it sends i get an error and when it goes to there inbox it say from Nobody and subject is Password and user in the email it shows....
username:
password:
but there isnt anything in there
here is the error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/haunted/public_html/The_Bored_Game/forgotpassword.php on line 14
line 14
$query = mysql_query($sql);
how can i make it where the it comes from my email address and in the email it would be like
Here is your username and password if you didnt request it dont worry your username and password only goes to your email box..
in your mysql_select_db you sho uld have quotes around haunted_BoringGame and also after $sql put or die(mysql_error());
also i dont see the point of your $query because its already queired in $sql,i think that may error also and if you want your emails to be accepted by yahoo and such you should check the php.net mail script with the proper headers
Smackie wrote:its suppose to send out the username and password if the username and email address is matched up.
Well, from security's point of view, you aren't supposed to send out the passwords through plain emails... since they may have used it somewhere else also. select any randomly-generated string for password and mail them that so that they can change their passwords after logging in with that one.