I'd like to apply an effect that worked the following way, a search on the form that when it was displayed the result on the page should automatically scroll in place of the div where the search result will be.
Please note: Can anyone show me an example of how to do this ??
This is part code that displays the results, how to deploy this javascript function in this code:
if ($resultados->num_rows > 0) {
while($linha = mysqli_fetch_array($resultados)) {
echo utf8_encode("<strong>Nome: </strong>" ."<strong>". $linha['nome']."</strong>" . "</br>");
print ("<strong>Endereço: </strong>" . $linha['endereco'] . "</br>");
if (isset($_POST['cidade']) && $_POST['cidade'] === 'sao-gabriel-da-palha') {
$fromPerson = 'São Gabriel da Palha';
echo "<strong>Cidade: </strong>" . $fromPerson . "</br>";
}
print ("<strong>Telefone: </strong>" . $linha['telefone'] . "</br>");
echo "<strong>email: </strong>" . $linha['email'] . "</br>";
if (isset($_POST['palavra'])) { // remover acentos
$palavra = preg_replace("/&([a-z])[a-z]+;/i", "$1", htmlentities(strtolower(trim($_POST['palavra']))));
}
if (!empty($palavra) &&
in_array($palavra, array('andrey ferraz', 'andrey', 'ferraz', 'andrey martins ferraz'))){
require 'andreyferraz.php';
}
} }else{
echo "<h3 align='center'>Empresa ainda não cadastrada!</h3>";