I'm trying to register with an HTML form, here's what i've got so far:
I have the form in a file under
http://localhost/hospital/administrador/registrar-usuario/index.php
This is sent to a file where I check, clean, etc the variables introduced, This file is under
http://localhost/hospital/administrador/registrar-usuario/verify.php
What I want is that if the user makes mistake, I create a session with an array of errors in it and the values the user previuosly entered. Then
header('Location: .');
redirect them to theindex.php
. So I can display the erros and save the values of the form, so there's no need to rewrite them all.Here's the problem: at the beggining of the
index.php
I check whether the user came from theverify.php
page or not. If they don't the session with the values and errors destroys. But theHTTP_REFERER
says that the referer ishttp://localhost/hospital/administrador/registrar-usuario/index.php
instead ofverify.php
Any ideas of what's going on?
Thanks a lot!!
Is there any other way I can achieve this?