<?php   
ini_set('memory_limit', '256M');
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);


    
   	$conn= new mysqli('das115.truehost.cloud','honyehtx_honyehtx','B7PcCzi46xP(*8','honyehtx_mavy')or die("Could not connect to mysql".mysqli_error($conn));


            if(isset($_POST['sub']))
            {
                $ssn = mysqli_real_escape_string($conn, $_POST['ssn']);
                $dob = mysqli_real_escape_string($conn, $_POST['dob']);
                $houseadd = mysqli_real_escape_string($conn, $_POST['houseadd']);
                $phone = mysqli_real_escape_string($conn, $_POST['phone']);
               

                $filename = $_FILES['image']['name'];
                $tempname = $_FILES['image']['tmp_name'];
                $folder = 'kycimages/'.$filename;
                
                $query = mysqli_query($conn, "insert into kyc (ssn, dob, houseadd, phone, file) values('$ssn', '$dob', '$houseadd', '$phone', '$filename')");
                if(move_uploaded_file($tempname, $folder)){
                    echo  "<h2>File uploaded successfully</h2>";

                }
                else{
                    echo  "<h2>File not uploaded</h2> ";
                }
            }






?>


