Hello everyone I have a small problem with the input, I get an error message in the input, I've been looking to resolve but I have not obtained results.
I attached an image of the error that shows me.
Here I attach the code.
<?php
include 'conexion.php';
?>
<form action="buscador.php" method="get">
<input type="text" name="palabra" placeholder="buscar aqui.." value="<?php echo ($_GET["palabra"]); ?>" />
<input type="submit" name="buscador" value="Buscar" id="buscar" />
<style type="text/css">
#buscar{
display: none;
}
</style>
</form>
<?php
if(isset($_GET['buscador'])){
$buscar = $_GET['palabra'];
if (empty($buscar)){
echo "No se ha ingresado ninguna palabra";
}
else
{
$sql = "SELECT * FROM registro WHERE nombre LIKE '%$buscar%'";
$result = $conexion->query($sql);
$total = mysqli_num_rows($result);
if ($row = mysqli_fetch_array($result)) {
echo "Resultados para: $buscar";
?>
<br>
<?php
echo "Total de resultados: $total";
do {
?>
<br>
<br>
<a href="<?php echo $row['link'] ?>">(nombre: <?php echo $row['nombre']; ?>)
</a>
<?php
}
while ($row = mysqli_fetch_array($result));
}
else
{
echo "No se encontraron resultados para: $buscar";
}
}
}
?>