I have a user login/registration system that simply uses
// execute queries, set cookies, etc. here
header("Location: " . getenv("HTTP_REFERER"));
I recently read a post about exit();
and die();
and had no idea that I was supposed to be using these. From what I understand, they make it end the PHP? Is that correct? What's the best way I can work toward this, simply adding one of these functions directly after ever header(); execution I have?
I have AJAX, jQuery reading through my login.php/register.php, will this be affect in any way?
Edit: Other than after header();, where else should I be usitilizing the exit();
or die();
functions? And is exit();
more used around PHP whereas die();
more used around Perl?
die
orexit
as long as you use one of them. – Leflerdie(header("location: {$url}"));
. – Infusive