Subscribed 2017-11-20T20:31:40+00:00

[insert_php]
if(!empty($_POST[’email’]) && $_POST[’email’]!=”){

if($_SERVER[‘HTTP_REFERER’]!=’http://code-brew.tech/’ && $_SERVER[‘HTTP_REFERER’]!=’http://code-brew.com/’){

mysql_connect(‘localhost’,’root’,’core2duo’);
mysql_select_db(‘codebrew’);
$sql = “insert into newsletter(email,referrer,ip_address,status)values(‘”.mysql_escape_string($_POST[’email’]).”‘,'”.mysql_escape_string($_SERVER[‘HTTP_REFERER’]).”‘, ‘”.mysql_escape_string($_SERVER[‘REMOTE_ADDR’]).”‘,’1’)”;
$res = mysql_query($sql);
}else{

mysql_connect(‘localhost’,’root’,’core2duo’);
mysql_select_db(‘codebrew’);
$sql = “insert into newsletter(email,referrer,ip_address,status)values(‘”.mysql_escape_string($_POST[’email’]).”‘,'”.mysql_escape_string($_SERVER[‘HTTP_REFERER’]).”‘, ‘”.mysql_escape_string($_SERVER[‘REMOTE_ADDR’]).”‘,’0’)”;
$res = mysql_query($sql);
}

}
[/insert_php]