dimanche 27 octobre 2019

Best way to handle a "username not available" situation (no jquery)?

I'm doing a project for university. This project consists in making a functioning website that includes registration and login. So I was asking myself, what is the best way (in my case, best = simple and consistent) to handle something like "username not available" during registration? I was thinking of using GET variables, so when my php script finds out that the username is not available, it redirects the user to the page: register.php?err=1, where err is a GET variable that register.php will handle in some way. But is this safe? I mean, someone could access the page register.php?err=1 and get the error always displayed. I'm sure there is a simple answer to this but I can't find anything that suits my very simple situation.




Aucun commentaire:

Enregistrer un commentaire