Jump to content

mail()


fabiez

Recommended Posts

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 {

}

Link to comment
https://forums.phpfreaks.com/topic/233400-mail/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.