user4fun Posted March 13, 2007 Share Posted March 13, 2007 $get_user = mysql_query("SELECT * FROM associnfo WHERE user_email = '".$_POST['em']."'");$q = mysql_fetch_object($get_user);if(!$q) die("FAILED. The email address does not exsist."); echo "information send to the submitted email";$to = "$em";$subject = "Your Pawword";$message = "<html>Your password is : <? echo '".$q['user_password']."' ?><br>more html code i know that password should be scambled and stuff, but just for nowin the emailed message the results isyour password is : and then it is empty???why is that? Link to comment Share on other sites More sharing options...
Mr_CHISOL Posted March 13, 2007 Share Posted March 13, 2007 It's not empty, youre adding a tag (<? ... ?>) that is treated as HTML and therefor not shown, you don't need the <? ?> and the echo simply just do like this: $to = "$em";$subject = "Your Pawword";$message = "<html>Your password is : {$q['user_password']}<br />... or $to = "$em";$subject = "Your Pawword";$message = "<html>Your password is : ".$q['user_password']."<br />... Whatever feels best for you Link to comment Share on other sites More sharing options...
user4fun Posted March 13, 2007 Author Share Posted March 13, 2007 i tried them both and unfortunatly the email gets send outyour password is: and then there is nothing againi am confused Link to comment Share on other sites More sharing options...
Mr_CHISOL Posted March 13, 2007 Share Posted March 13, 2007 I see the problem (I think...).mysql_fetch_object() doesn't return an array, it returns an object.To get the values from the object yo must use this "format": $q->user_password If you want to use arrays/hashes you must use mysql_fetch_array() or mysql_fetch_assoc(). Link to comment Share on other sites More sharing options...
user4fun Posted March 13, 2007 Author Share Posted March 13, 2007 sorryto be so stupid, but the final code would look how? Link to comment Share on other sites More sharing options...
Mr_CHISOL Posted March 13, 2007 Share Posted March 13, 2007 $get_user = mysql_query("SELECT * FROM associnfo WHERE user_email = '".$_POST['em']."'");$q = mysql_fetch_assoc($get_user);if(!$q) die("FAILED. The email address does not exsist."); $to = "$em";$subject = "Your Password";$message = "<html>Your password is : ".$q['user_password']."<br />More Text";mail( $to, $subject, $message );echo "information send to the submitted email"; or $get_user = mysql_query("SELECT * FROM associnfo WHERE user_email = '".$_POST['em']."'");$q = mysql_fetch_object($get_user);if(!$q) die("FAILED. The email address does not exsist."); $to = "$em";$subject = "Your Password";$message = "<html>Your password is : ".$q->user_password."<br />More Text";mail( $to, $subject, $message );echo "information send to the submitted email"; Something like that (the last uses object and the first array/hash). Link to comment Share on other sites More sharing options...
user4fun Posted March 14, 2007 Author Share Posted March 14, 2007 The first one works like acharm, i can display the password and all theother infromation that i wantThank you very much for your helpthe first timethe second timeand the third timeand so on Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now