语法错误,我的代码出现意外的文件结尾


syntax error, unexpected end of file on my code

对不起,伙计们,我不知道我的代码中的错误在哪里——它一定是一个简单的{
这是一个将imgs上传到数据库的简单表单,所以如果有人想要,可以随意使用它。

<html>
<body> 
    <form method="post" action="">
        <p>Selecionar imagem:</p>
        <input type="file" name="fileToUpload" id="fileToUpload">
        <p>descricao:</p>
        <input name="descricao" type="text">
        <p>categoria:</p>
        <input name="categoria" type="text">
        <input type="submit" value="Submit" name="submit">
    </form>
</body>
</html>
<?php
    $con = mysql_connect("localhost", "root", "", "galeria");
    if (!$con)
    {
        die('Could not connect: '.mysql_error());
    }
    mysql_select_db("galeria", $con);
    if (isset($_POST["submit"]))
    {
        $sql = "INSERT INTO gallery (id,lowsrc,fullsrc,description,category)
    VALUES
    ('','$_POST[fileToUpload]','$_POST[fileToUpload]','$_POST[descricao]','$_POST[categoria]')";
        if (!mysql_query($sql, $con))
        {
            die('ERRO: '.mysql_error());
        }
        echo "adicionado";
        if (array_key_exists("submit", $_POST))
        {
            $target_dir = "full/";
            $target_file = $target_dir.basename($_FILES["fileToUpload"]["name"]);
            $uploadOk = 1;
            $imageFileType = pathinfo($target_file, PATHINFO_EXTENSION);
            if (isset($_POST["submit"]))
            {
                $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
                if ($check !== false)
                {
                    echo "OK - ".$check["mime"].".";
                    $uploadOk = 1;
                }
                else
                {
                    echo "Não é uma imagem";
                    $uploadOk = 0;
                }
            }
            // Check if file already exists
            if (file_exists($target_file))
            {
                echo "Ficheiro ja existe!";
                $uploadOk = 0;
            }
            // Check file size
            if ($_FILES["fileToUpload"]["size"] > 500000)
            {
                echo "Ficheiro muito grande!";
                $uploadOk = 0;
            }
            // Allow certain file formats
            if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif")
            {
                echo "Apenas JPG, JPEG, PNG e GIF são permitidos";
                $uploadOk = 0;
            }
            // Check if $uploadOk is set to 0 by an error
            if ($uploadOk == 0)
            {
                echo "ERRO";
                // if everything is ok, try to upload file
            }
            else
            {
                if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file))
                {
                    echo "Upload Feito";
                }
                else
                {
                    echo "ERRO";
                }
            }
        }
?>

我已经解析了您的代码,它说您需要在最后一个结束标记之前添加一个额外的括号}

在末尾添加闭合花括号}