
<?php
if (isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ))
{
include_once "../includes/connectConfig.php";

/*****************************************ADDING ITEM TO CART TABLE***************************/

$emailsdrs = test_input($_POST['emailsdrs']);

$chkmail = gtOne("mart_news_subscribers"," email = '$emailsdrs' ",'ns_id');
if(!empty($chkmail)){
	
	$output["respn"] = "Already Subscribed.";
	echo json_encode($output);
	exit;
}
else{
	
	$crt_mail = $db_con->prepare("INSERT INTO mart_news_subscribers (email) VALUES(:user_mail)");
	$crt_mail->bindParam(':user_mail',$emailsdrs); $crt_mail->execute();
		
		
	$output["respn"] = "Thanks for Subscribing.";
	echo json_encode($output);
	exit;
}

}
?>
