Good I have the following doubt I have the following functions PHP
in a file, the thing is that I want that by pressing a button (delete) the function is called delete and delete the record.
How can you do that without calling a funcion js
.
Greetings
// funciones.php
function eliminarUsuario($rut){
$consulta ="DELETE FROM usuario WHERE rut ='$rut' ";
$conexion = conectarServidor();
$query = $conexion->query($consulta);
if ($query) {
echo "Eliminado Correctamente";
}
else{
echo "Error";
}
}
formularioEliminarUsuario.php
<button type="submit" class="btn red">Eliminar</button>