echo "<script type=\"text/javascript\">";
echo "function del_cookie()";
echo "{";
echo "document.cookie = logged_amount + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';";
echo "}";
echo "</script>";
echo "<form action=logout.php name=Logout>";
echo "<input type=submit name=submit value=\"Log Out\"> | <a href='./archive.php'>View History</a> | <a href='#' onclick='del_cookie'>Mark as read</a><form>";
setcookie("logged_amount", $x, time() + 60 * 60 * 24 * 30);
When I try to click “Mark as read” it doesn’t really work. Am I missing something? Also if I can I’d really like to update the cookie with the $x value.
I gave up with javascript.