Well, in outline, if you had a checkbox next to the article
Code:
<input type="checkbox" name="subscribe">
you could use its onclick event:
Code:
if (this.checked) {
// send ajax request with somepage.php?art=idnumber&subs=1
// and possibly include the userid
} else {
// send ajax request with somepage.php?art=idnumber&subs=0
}
then somepage.php could:
PHP Code:
<?php
if (isset($_GET['subs']) && !empty($_GET['subs'])) {
$subs = (int) $_GET['subs'];
if ($subs == 1) {
// check and sanitize the userID and articleID
// execute SQL to insert userID and articleID
} else {
// check and sanitize the userID and articleID
// execute SQL to delete userID and articleID
}
}
?>
Of course, this assumes that you are using PHP.