From 7949e3f8c1933b908ad311081b8535542bc157a2 Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Wed, 8 Aug 2018 11:58:00 -1000 Subject: [PATCH] users can now change their email address --- includes/update-email.php | 10 +++++++++- preferences.php | 13 +++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) 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 '

Change e-mail and / or password



'; +echo '

Change e-mail and / or password

'; // listing all session variables currently set for debugging purposes echo '
';
 var_dump($_SESSION);
-echo '


'; +echo '
'; // delete the above 3 lines when done echo '
'; echo ''; -echo ''; +echo ''; echo '
Update e-mail address

'; include_once ('footer.php'); ?> \ No newline at end of file