PHP连接到xampp失败

Heres my code in the php,

See as Text

if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
    include 'DatabaseConfig.php';

    $con = mysqli_connect($HostName, $HostUser, $HostPass, $DatabaseName);
    $Email = $_POST['User_Email'];
    $Password = $_POST['User_Password'];
    $Full_Name = $_POST['User_Full_Name'];
    $CheckSQL = "SELECT * FROM register_account WHERE User_Email='$Email'";
    $check = mysqli_fetch_array(mysqli_query($con, $CheckSQL));
    if (isset($check))
    {
        echo 'Email Already Exist, Please Enter Another Email.';
    }
    else
    {
        $Sql_Query = "INSERT INTO register_account values(User_Email,User_Password,User_Full_Name) values ('$Email','$Password','$Full_Name')";
        if (mysqli_query($con, $Sql_Query))
        {
            echo 'User Registration Successfully';
        }
        else
        {
            echo 'Something went wrong';
        }
    }
}

mysqli_close($con);

and here's the error when i try to check it on my browser

Notice: Undefined variable: con in C:\xampp\htdocs\android\User-Registration.php on line 36

Warning: mysqli_close() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\android\User-Registration.php on line 

i've checked my db and codes as many times as i cant but seems like still didnt work forme. can anyone help me out please? thanks!

Well, check your code: you are only running mysqli_connect if a POST request occured, but you are running mysqli_close in every request

<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {

    include 'DatabaseConfig.php';

    $con = mysqli_connect($HostName, $HostUser, $HostPass, $DatabaseName);

    $Email = $_POST['User_Email'];

    $Password = $_POST['User_Password'];

    $Full_Name = $_POST['User_Full_Name'];

    $CheckSQL = "SELECT * FROM register_account WHERE 
       User_Email='$Email'";

    $check = mysqli_fetch_array(mysqli_query($con, $CheckSQL));

    if (isset($check)) {

        echo 'Email Already Exist, Please Enter Another Email.';

    } else {
        $Sql_Query = "INSERT INTO register_account 
      values(User_Email,User_Password,User_Full_Name) values 
     ('$Email','$Password','$Full_Name')";

        if (mysqli_query($con, $Sql_Query)) {
            echo 'User Registration Successfully';
        } else {
            echo 'Something went wrong';
        }
    }
    mysqli_close($con);
}
?>