Location: PHPKode > scripts > Reviews > reviews/example1b_confirm.php
<?php
if(isset($_GET['confirm'])) {
	try {
		// including rating class
		include_once('Xoriant_Reviews.php');
		$Reviews = new Xoriant_Reviews();
		$data['item_id'] = $_GET['item_id'];
		$data['rating_id'] = $_GET['rating_id'];
		$data['confirm_user_id'] = 1;
		$data['confirm'] = $_GET['confirm'];
		$data['confirm_ip'] = $_SERVER['REMOTE_ADDR'];
		$data['uniqueip'] = 0;
		$data['uniqueuser'] = 0;
		$data['confirm_date'] = date('Y-m-d H:i:s');
		if($data['uniqueip']=="1") {
			$count = $Reviews->checkConfirmUniqueIp($data);
			if($count>0) throw new Exception("Duplicate Ip");
		}
		if($data['uniqueuser']=="1") {
			$count = $Reviews->checkConfirmUniqueUser($data);
			if($count>0) throw new Exception("Duplicate User");
		}
		$confirm_rating_id = $Reviews->phpinsert('xoriant_reviews_ratings_confirm', 'confirm_rating_id', $data);
		header("Location: example1b.php?item_id=".$_GET['item_id']);
		exit;
	} catch (exception $e) { 
		$errorMessage = $e->getMessage();
		echo $message = $errorMessage;
	}
}
?>
Return current item: Reviews