view user/unsubscribe.php @ 56:5f772caee9a7

try getting review from DB if throttled
author Charlie Root
date Fri, 07 Jun 2019 16:36:06 -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);

?>