<?php
	session_start();
	include"../../connect/db.php"; 
 ?>  
<?php
	if( $_POST['user'] ){
		$chap = $_POST['user'] ;

		$sql = mysqli_query($con, "SELECT * FROM users WHERE email = '$chap' ");

		while( $row = mysqli_fetch_assoc($sql) ){
			echo
			'
                <div class="login-form">
                    <form class="regForm" id="formpic">
                        <div class="form-group" style="text-align: center;">
                            <img id="blah1" src="../'.$row['img_path'].'" style="margin: 20px;    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);" class="img-thumbnail" alt="your image">
                            <input style="margin:0 auto;"  onchange="readURL1(this);" type="file" class="form-control-file" id="profile-pic-update" name="profile-pic-update" required="">                                   
                        </div>                    
                        <div class="form-group">
                            <input class="au-input au-input--full" type="hidden" name="email"value="'.$row['email'].'" >
                        </div>
                        <span onclick="updatePic()" class="btn btn-success" class="au-btn au-btn--block au-btn--green m-b-20">Update</span>
                    </form>    
                </div>
			';
		}
	}
	else{

		echo "error";
	}
?>