diff --git a/includes/update-email.php b/includes/update-email.php
index 6f8e655..1a19546 100644
--- a/includes/update-email.php
+++ b/includes/update-email.php
@@ -1,3 +1,11 @@
';
+include_once ('verifications.php');
+echo 'the useremail variable is: ' . $_POST['useremail'] . '
';
+echo 'the userid variable is: ' . $_SESSION['userid'] . '
';
+$updmail = $con->prepare("UPDATE userinfo SET usermail = ? WHERE userid = ?");
+$updmail->bind_param("si", $_POST['useremail'], $_SESSION['userid']);
+$updmail->execute();
+$_SESSION['usermail'] = $_POST['useremail'];
+echo 'Email address updated, redirecting.';
+header ("Refresh:2; url=preferences.php");
?>
\ No newline at end of file
diff --git a/preferences.php b/preferences.php
index c2c6762..3b053c8 100644
--- a/preferences.php
+++ b/preferences.php
@@ -1,25 +1,22 @@
';
- echo 'the post usermail vaiable should be blank: ' . $_POST['usermail'] . ' <- Is there a blank spot to the left?
';
}
-echo '
'; var_dump($_SESSION); -echo '