<?php require_once 'sessao.php'; 

$dominio = sql($_POST['dominio']);
if(strlen($dominio) == 0){
header("Location: add_dominio.php?erro");
exit;
}
$password = hash("whirlpool",$senha);

	$query_usuario = mysql_query("SELECT * FROM `domains` WHERE `dominio`='$dominio' AND `id_user`='0'");
	if(mysql_num_rows($query_usuario) == 1){
		header("Location: add-dominio-publico.php?duplicado");
		exit;
	}
		$query = mysql_query("INSERT INTO `domains` (`dominio`, `id_user`) VALUES ('$dominio', '0')");
		if($query){
			header("Location: add-dominio-publico.php?sucesso");
			exit;
		}else{
			header("Location: add-dominio-publico.php?error");
			exit;
		}

?>