if you want new field email to insert in the database make sure that this field exist.
if it does change the function to following:
<?
function addNewUser($username, $password){
global $conn;
$q = "INSERT INTO users VALUES ('$username', '$password','$email')";
return mysql_query($q,$conn);
}
?>
if it should be a mandatory field, change this part
<?
if(isset($POST['subjoin'])){
/ Make sure all fields were entered /
if(!$POST['user'] || !$_POST['pass']){
die('You didn't fill in a required field.');
}
?>
to
<?
if(isset($POST['subjoin'])){
/ Make sure all fields were entered /
if(!$POST['user'] || !$_POST['pass'] || !$POST['email']){
die('You didn't fill in a required field.');
?>
and then change this line:
<?
$SESSION['regresult'] = addNewUser($POST['user'], $md5pass);
?>
to
<?
$SESSION['regresult'] = addNewUser($POST['user'], $md5pass,$_POST['email']);
?>
I didn't check it out but this should work, i hope ;-)