I made a site with login, registration, and so on. I validated the login and the registration with POST method, the site is on the server and everything, but when I put the url link already from inside the page it loads. Is it some mistake I may have made or is it "normal"?
LOGIN
<form name="formulario" id="formEnvia" action="valida.php" method="POST">
<label >CPF*</label>
<input type="text" id="cpf" name="cpf" class="form-control input-lg" placeholder="000.000.000-00" maxlength="14" pattern="\d{3}\.\d{3}\.\d{3}-\d{2}"
title="Digite o CPF no formato nnn.nnn.nnn-nn" required />
<br>
<label inputemail>E-mail*:</label>
<input type="email" id="inputEmail" name="inputEmail" class="form-control input-lg " placeholder="[email protected]" maxlength="50" required/>
<br>
<button type="submit" onclick="valida_envio()" class="btn btn-primary btn-lg btn-block">
<span class="glyphicon glyphicon-ok"></span>
Acessar</button>
</form>
LOGIN VALIDATION:
<?php
require_once "conexao.php";
$email = $_POST['inputEmail'];
$cpf = $_POST['cpf'];
$query = "SELECT * FROM usuarios WHERE cpf = '$cpf' AND email = '$email'";
$querySelect = mysqli_query($conn,$query);
if(mysqli_num_rows($querySelect) <=0){
echo"<script type='text/javascript'>alert('Email ou cpf incorretos.');window.location.href='index.html';</script>";
die();
}else if(mysqli_num_rows($querySelect) > 0 ){
setcookie("login", $cpf);
header("Location:Postagem.html");
}