GIF89a php
Current File : /home/hencockfreshchic/public_html/saveSubscribers.php
<?php
ob_start();
ini_set('error_reporting', E_STRICT);
include("connect.php");
mysqli_set_charset($conn,'utf8');
date_default_timezone_set('Asia/Kolkata');
include("sql_content.php");

$emailid=$_GET['emailid'];
$ip=$_SERVER['REMOTE_ADDR'];

// check the data 
$sql2="SELECT * FROM `subscribers` WHERE `emailid`='".$emailid."'";
$rs2=mysqli_query($conn,$sql2);
$check2=mysqli_num_rows($rs2);
if($check2>0){
	$sql3="UPDATE `subscribers` SET `ip_address`='".$ip."' WHERE `emailid`='".$emailid."'";
	$rs3=mysqli_query($conn,$sql3);
	echo "2";
}
else
{
$sql="INSERT INTO `subscribers`(`emailid`,`ip_address`) VALUES ('".$emailid."','".$ip."')";
$rs=mysqli_query($conn,$sql);
if($rs>0)
{
	// send email 
	$date=date('Y-m-d')."( ".date('H:i:s')." )";
	
	 $to = $emailid;
$subject = "New Subscription welcome from Awas";

$message = "
<html>
<head>
<title>Welcome to awas subscription.</title>
</head>
<body>
<p>Dear User,<br><br> Your hearlty welcome to Awas subscription panel. \n Your email has been attached to our latest updates and offers. \n In future , if any latest updates and offers we have then we will update you via a email. \n Subscription is our priority based section. \n For further more information and quaries , please contact us here  : <br>
<a href='http://techeor.co.in/awas/contact.php'>click here </a>

<br><br> </p>
/*Subject : '.$subject.'<br>*/


<br><br><img src='http://techeor.co.in/awas/images/logo.png' style='width:100px; height:60px'><br><br>
mail server : <a href='http://techeor.co.in/'><font size='3px'>Techeor Technology</font></a>
</body>
</html>
";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: '.$from_email. "\r\n";
$headers .= 'Cc: '.$to_email. "\r\n";

$data=mail($to,$subject,$message,$headers);
if($data>0)
{
	echo "1";
}
else
{
	echo "0";
}
}
else
{
	echo "0";
}
}
?>