Mercurial > hg > ywww
view user/unsubscribe.php @ 46:b7376319d25a
centralise db query even more
author | Charlie Root |
---|---|
date | Sun, 06 Jan 2019 12:15:42 -0500 |
parents | 077b0a0a3e6d |
children | 385ddd7c4b55 a67bf725e87b |
line wrap: on
line source
<?PHP $email = strval($_GET['email']); include "../../private/db.php"; $query = "update userpref set ReceiveEmail = 0 where UserID in (select UserID from user where Email = '$email') "; $results = mysqli_query($link, $query); if ( $results ) { $redirectURL = "unsubscribe.html"; header("Location:$redirectURL"); } else{ echo "<p>Error updating preferences. Please email <a href=\"mailto:feedback@yournextread.com?subject=Unsubscribe Problem\">feedback</a></p>"; } mysqli_close($link); ?>