<?php
	include "../../connection/conn_marseille.php";
		$email = $_POST['email'];
		$data = date("Y-m-d");
		$numr		=		mysql_query("SELECT * FROM tb_newsletter WHERE email = '$email'");
		if(mysql_num_rows($numr) == 0 AND $email <> ""){
		$sql = "INSERT INTO tb_newsletter (email, data) VALUES ('$email', '$data')";
		mysql_query($sql) or die(error());
		$response = array("success" => true);
		echo json_encode("<p class='return-news-ok'>Obrigado! Cadastro efetuado com sucesso.</p>");
		} else {
			echo json_encode("<p class='return-news-erro'>Este e-mail já está cadastrado!</p>");
		}
?>