fabiez Posted April 11, 2011 Share Posted April 11, 2011 Three post variables are recived from a previous page. All three are inserted into a table, then a mail is compost based on the post variables. And the mail printout was: Welcome. Your login information is: User: $usr Password: $pw So how do I give the user his info without printing the variable? require("id.php"); $usr = $_POST['usr']; $pw = $_POST['passwd']; $email = $_POST['email']; $Link = mysql_connect($Host, $User, $Password); mysql_select_db('db', $Link); $Sql = "select user from users where user='$usr'"; $Result = mysql_query($Sql, $Link); $Num = mysql_num_rows($Result); $Result = mysql_fetch_array($Result); if($Num == 0){ $Sql2 = "INSERT INTO users (user, password, email) VALUES ('$usr', sha1('$pw'), '$email')"; mysql_query($Sql2, $Link); $from = '[email protected]'; $subject = 'Welcome'; $message = 'Welcome. Your login information is: User: $usr Password: $pw'; mail("$email", $subject, $message, "From: $from"); } else { } Quote Link to comment https://forums.phpfreaks.com/topic/233400-mail/ Share on other sites More sharing options...
requinix Posted April 11, 2011 Share Posted April 11, 2011 Learn about strings Quote Link to comment https://forums.phpfreaks.com/topic/233400-mail/#findComment-1200228 Share on other sites More sharing options...
fabiez Posted April 11, 2011 Author Share Posted April 11, 2011 thanks Quote Link to comment https://forums.phpfreaks.com/topic/233400-mail/#findComment-1200250 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.