<?php 
include("db_config.php"); 
if($_SERVER['REQUEST_METHOD']=='POST'){
     $user_id = $_POST['user_id'];
     $fname = $_POST['fname'];
     $email = $_POST['email_id'];
     $mob_no = $_POST['mob_no'];
	 $rand = md5(uniqid().rand());
     $pic1=$rand."p".".jpg";
     $image =$_POST['image'];
     $actualpath1 = "../admin/img/profile/$pic1";
	$sql1 ="UPDATE  user_profile  SET fname='$fname',mob_no='$mob_no',email='$email',prof_img='$pic1'  WHERE id='$user_id'"; 
	//echo $sql1;exit();
    $res=mysqli_query($conn,$sql1) or die(mysqli_error());
     if($res){
     file_put_contents($actualpath1,base64_decode($image));
    // var_dump($name);exit();
	  $response['status']=1;
	}
	else {
		$response['status']=0;
	}
	echo json_encode($response);
	mysqli_close($conn);
}