I am working on a PHP login project.
I have 3 documents:
index.php
auth.php
home.php
index.php posts to auth.php. If successful auth redirects to home.php. On failure it exits with a message.
Works perfectly, however I want to give my users a better experience and have index.php report the errors. What is the recommended way to pass errors off to index.php? Store them in a session and check if the session is set to display them, or pass it though a GET, like this:
header('Location: index.php?error='.$error);
exit;
Or should I just redo everything using AJAX or hopefully there's other options that I haven't though of.