<?PHP
if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['submit'])) {
$name= $_POST['user_name'];
$email = $_POST['user_email'];
// mysql_connect() here
$sql = 'INSERT INTO users username, email VALUES ("'.mysql_real_escape_string($name).'", "'.mysql_real_escape_string($email).'");';
$result = mysql_query($sql);
// error checking here for the returned result
mail($email, 'Welcome!', 'Message', $headers); // or whatever you want here
// set the $_SESSION['logged_in'] variable to true, or however you flag users
// as logged in
?>
Also, please use the board to ask questions in the future, not the contact form on our personal websites. The board allows other people with the same problem to look it up in the future, preventing the same questions over and over again (in theory).
}