0
I have a website, and it has the registration and when the registration already exists it shows an Alert saying this (this Alert I did in js, but it was within php), but when I put the page to be mobile, the Alert does not appear, as I put to appear or show an error message? (all this by php)
The user will put Cpf and email to register, if you already have in the bd, he will inform. Ta thus:
PAGE: processes.php
if (mysqli_num_rows($querySelect) > 0) {
echo"<script type='text/javascript'>alert('Alguém com esses dados já se cadastrou. Tente novamente.');window.location.href='cadastro.php';</script>";
}
But I wanted Alert to show the mobile too, only it doesn’t show.
This is the registration page (I’ll just put the boot):
Page: cadastro.php
<button type="submit" class="btn btn-primary btn-lg btn-block" id="cadastrar" name="cadastrar" disbled/ >
<span class="glyphicon glyphicon-ok"></span>
<span id="cpf"></span>Cadastrar</button>
Show me what you got.
– Thiago
@Thiago Pronto.
– Maria
I would use http://api.jquery.com/jquery.ajax/ to request the page
processa.php
and she would simply have as a body the result of the condition ofmysqli_num_rows($querySelect) > 0
that would betrue
orfalse
and then you would show an Alert if the result of the request wastrue
. This would work perfectly on desktop and mobile and would be pleasant to the user since there would be no kind of redirection.– Paulo Roberto Rosa