view user/unsubscribe.php @ 60:05f29eb72283 default tip

review from DB not working???
author Charlie Root
date Sun, 09 Jun 2019 06:50:44 -0400
parents a67bf725e87b
children
line wrap: on
line source

<?PHP

$email = strval($_GET['email']);

include "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);

?>