I can not find the error parse error [closed]

1

I have the following code in php:

<?php
include ("conex.php");
if ($_SERVER["REQUEST_METHOD"] == "POST"){
    $centro = mysqli_real_escape_string($con,$_POST['centro']);
    $descripcion = mysqli_real_escape_string($con,$_POST['descripcion']);
    if($centro<> "" and $descripcion <> "")
    {
        session_start();
        $congregacion = $_SESSION['congregacion'];
        $sql = "INSERT INTO centros_salidas (id_centro, id_congregacion, nombre, descripcion) VALUES (NULL, '$congregacion', '$centro', '$descripcion')";
        mysqli_query($con, $sql);
        echo mysqli_error($con);
        if(mysqli_affected_rows($con)){
            mysqli_close( $con);
            $html= 1;
        }else{
            mysqli_close($con);
            $html= 0;
        }
    }else{
        $html.= 2;
    }   
    echo $html;
}   
?>

I get the following error message:

  

Parse error: syntax error, unexpected end of file in C: \ AppServ \ www \ Control_Territorios \ php \ reg_territorio.php on line 25.

and I'm really looking to see if I need some {or any; but I do not see that I need anything, it is more the error tells me that it is online 25 which is the end of the script, I do not know what it could be.

I appreciate your help.

    
asked by Familia Valencia Hdz 29.01.2018 в 03:25
source

1 answer

3

As the comments tell you, the problem is that you have cast the characters aAg on line 19. Delete it and it should work.

I also recommend that you delete the final closing tag from php ?> is not necessary and can sometimes fail you.

    
answered by 29.01.2018 в 09:56