<?php
include("config.php");
//Create account Begin
	error_reporting(0);
	if(isset($_REQUEST['create_acc']))
 {
	  $name=$_REQUEST['name'];	
	 $email=$_REQUEST['email'];
	 $pword=$_REQUEST['pword'];
	 $door_no=$_REQUEST['door_no'];
	 $locality=$_REQUEST['locality'];
	 $street=$_REQUEST['street'];
	 $state=$_REQUEST['state'];
	 $city=$_REQUEST['city'];
	 $district=$_REQUEST['district'];
	 $pincode=$_REQUEST['pincode'];	 
	 $phone=$_REQUEST['contact_no'];
	
	 //send activation email
	   $activation = "".$activatieon_url."/activate.php?code=0&&email=$email";
       $to =$email;
       $subject = "".$email_title_website." - Activate your account";
	   $headers  = 'MIME-Version: 1.0' . "\r\n";
       $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
       $headers .= 'From:<'.$adminemailid.'> ' . "\r\n";
       $headers .= 'Cc: ' . "\r\n";
       $headers .= 'Bcc: ' . "\r\n";
       
      $headers .= '"Content-type: text/plain; charset=iso-8859-1"'; 
    $headers.="X-Priority: 3\r\n"; 
    $headers.="X-Mailer: smail-PHP ".phpversion()."\r\n"; 
	   
	
	  $body = "
	   <html><head></head><body>
<table width=500 align=center border=1 bgcolor=#ffffff rules=none bordercolor=#669423>
<th colspan=2 bgcolor=#9ea900><font color=#ecf9ac>Registeration Details</font></th>
<tr><td width=150 align=center bgcolor=#ecf9ac><b>User Name:</b></td><td align=center><b>".$email."</b></td></tr>
<tr><td width=150 align=center bgcolor=#ecf9ac><b>Password:</b></td><td align=center><b>".$pword."</b></td></tr>
</table></body></html> <br>
	  Hello ".$username.",\n\nYou registered and need to activate your account.<br> Click the link below or paste it into the URL bar of your browser\n\n
	   <a href='$activation'>Click to Login</a>  \n\nThanks!<br>
	   Infostech Team.
	   ";
              	mail($to,$subject,$body,$headers,$code);
              
              	/* $url ='http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp?username=darsara&password=indian12&sendername=dasara&mobileno='.$phone.'&message=Your-Account-has-been-successfully-created.';
		$ch = curl_init($url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		$curl_scraped_page = curl_exec($ch);
		curl_close($ch);
		 $curl_scraped_page; */
	
		 $select="select * from `user_account`";
	 mysql_query($select);
	 
	 $insert="insert into `user_account`(`date`,`time`,`name`,`username`,`password`,`door_no`,`locality`,`street`,`district`,`state`,`city`,`pincode`,`phone`,`code`)values('".date("Y-m-d")."','".date("g:i a")."','$name','$email','$pword','$door_no','$locality','$street','$district','$state','$city','$pincode','$phone',0)";
	 $add=mysql_query($insert);
	 ?><script>window.location="register.php?add=Success";</script><?
 }
 ?>