Location: PHPKode > projects > Wiki Web Help > wwh/handlers/subscribe.php
<?php
require_once("../config.php");

$page = $_POST['pid'];
$uid = $_POST['uid'];
if(!is_numeric($page) || !is_numeric($uid)) exit; 

$add = $_POST['val'] == "true" ? TRUE : FALSE;

if($add){
	$sql = "INSERT INTO `subscription` VALUES('', $page, $uid)";
	$result = mysql_query($sql, $con);
}else{
	$sql = "DELETE FROM `subscription` WHERE page_id=$page AND user_id=$uid";
	$result = mysql_query($sql, $con);
}

?>
Return current item: Wiki Web Help