Part of the code for email notifications and messages - Welcome to the user in private.
This code should be inserted immediately after the user record in the database.
You can change how you want:)

$usid = mysql_insert_id();
echo '<span style="color:red">You are login!</span><br/>';
echo "Your id: " . $usid . "<br/>";
echo "Your login: " . $reg_nick . "<br/>";
echo "your passs: " . $reg_pass . "<br/>";
echo "birthday: " . $user_day . " " . $user_month . " " . $user_year . "<br/>";
echo "In your email has been sent a link to autologin and your registration data<br/>";
echo 'Link to autologin:<br/><input type="text" value="' . $home . '/auto.php?id=' . $usid . '&amp;p=' . $reg_pass . '" /><br/>';

// notified by mail
$email = $mail;
$text = "Wellcome!\nRegister your account on $copyright was successful!\nlink to autologin:\n$home/auto.php?id=$usid&p=$reg_pass\nYour id: $usid\nYour Login: $reg_nick\nYour pass: $reg_pass\nSave these details\nPlease, go to your profile and fill in additional data\n--------\nAdministration Portal $copyright\nvisit us often!!!\n\n";
$subject="Register with us $copyright";
$text=utf8_win ($text);
$subject=utf8_win ($subject);
$headers = "MIME-Version: 1.0\r\n"."Content-type: text/plain; charset=Windows-1251\r\n".'From: '.$_SERVER['SERVER_NAME']."\r\n".'Reply-To: '.$_SERVER['SERVER_NAME']."\r\n".'X-Mailer: PHP/'.phpversion();
@mail($email, $subject, $text, $headers);

////////////////////////messages - Welcome
$msg1 = '<b>Welcome to the portal '.$copyright.'!</b><br />To start using the system recommended to enter your personal cabinet (top menu) and get acquainted with all the features available for registered users,<br />as well as the same sign in my profile and fill in additional information and upload a photo.<br />If you encounter any problems, or that does not work, you can ask questions to me, only with a detailed description of your problem, indicating the type of your browser, or phone.<br />Others were encouraged to read the section <a href="../read.php">FAQ</a> which is in the category of information.<br />So the same can apply to any matters to all of <a href="../str/moders.php">Administrative structure</a> portal '.$copyright.'<br />';
mysql_query("insert into `privat` values(0,'" . $reg_nick . "','".$msg1."','" . $realtime . "','".$nickadmina."','in','no',' !','0','','','','');");
////////////////////////Letter of notification to admin
$msg1 = '<b>The portal '.$copyright.' new registration!</b><br />User: <b>'.$reg_nick.'</b><br />Name: <b>'.$reg_name.' '.$patronymic_user.' '.$last_name_user.'</b><br />City: <b>'.$live.'</b><br />Birthday: <b>'.$user_day.' '.$user_month.' '.$user_year.'</b><br /><a href="../str/anketa.php?user='.$usid.'">View profile</a>';
mysql_query("insert into `privat` values(0,'" . $nickadmina . "','".$msg1."','" . $realtime . "','".$reg_nick."','in','no','Notice of new registration','0','','','','');");
