<?php
require_once 'config.php';

   $errors=array();
     //echo "SELECT * FROM users WHERE email=".$_GET['email_id'];die;
	   $users=mysqli_fetch_array(mysqli_query($con,"SELECT * FROM users WHERE email='".$_GET['email_id']."'"));	   
	   
		//$users=mysqli_fetch_array(mysqli_query($con,$sql12));
		
		if(!empty($users)){
			$to = $users['email'];
			$subject = "Your password for Trendinfo App ";
			$txt = "Your password is:  ".$users['password']."\r\n";
			$headers = "From: noreply@trendinfotechs.com" . "\r\n" ;

			mail($to,$subject,$txt,$headers);
			$errors['success']=true;						
			$errors['message']='pssword send successfully';
		
		}else{
			$errors['success']=false;						
			$errors['message']='Incorrect email id';
		}		

		
	
 	 
	 	echo json_encode($errors);