Replace html components with javascript

0

Good afternoon, everyone! I have an application that contains a dropdown that owns the user name and within this dropdown has a form pro user to put their data to login. This form is directed to a verification and after the verification, the user is redirected to the main page, however, I would like that when the page loads, the contents of dropdown also change. Does anyone know how I can do this?

Here is my form code

<div class="dropdown">
    <center> <li style="display: block; width: 100px; margin-right: 10px; margin-left: 40px;"><a style="color: #ccc; text-decoration: none;" href="#"> <img src="images/user.png" width="35px"><br> Sua conta  </a></li> </center>
    <div class="dropdown-content">
        <form name="formLogin" id="formLogin" action="verificaLogin.php" method="post">
            <input style="width:250px;" type="email" id="userLogin" name="userLogin" placeholder="Digite seu email">
            <br>
            <input style="width:250px;" type="password" id="userPassword" name="userPassword" placeholder="Digite sua senha">
            <br>
            <input type="submit" value="Entrar" id="btnLogar" name="btnLogar" style="width: 100px;">
            <a name="recuperaSenha" id="recuperaSenha" href="#"> Esqueci minha senha </a>
            <br> <br>
            <p style="color: #777"> Ainda não pussui conta? <a style="text-decoration: underline;" name="Cadastro" id="Cadastro" href="#"> Cadastre-se </a> 
            </p>
        </form>
    </div>
</div>  
[/code]

And this is my verification code

<?php
include 'conectaBanco.php'; 
include 'loginVO.php';
include 'loginDAO.php';

$login = new loginVO;
$loginDAO = new loginDAO;
$mysqli = new mysqli("localhost", "root", "", "bdPaiDaElo");

if(NULL !== filter_input(INPUT_POST, "btnLogar")){
    $login ->setEmailLogin(filter_input(INPUT_POST, "userLogin"));
    $login ->setSenhaLogin(filter_input(INPUT_POST, "userPassword"));

    if(!$login ->getEmailLogin() || !$login->getSenhaLogin()){
        echo "<script> alert('Por favor, verifique se digitou seu email e/ou senha corretamente') </script>";
    } else { 
        if($loginDAO ->selecionaLogin($login)){
            session_start();
            echo '<script> window.location.replace("index.php"); </script>';
        }

    }
}
?>
    
asked by anonymous 27.04.2017 / 21:33

0 answers