when I click the register button, I get a popup form (pictured) and the URL becomes
after registering, the URL still has the #register on the end.
Dont I need to remove it?
heres the logic
if(empty($errors))
{
$_SESSION['success_message'] = 'Your registration information has been saved. Check your email to complete the registration process.';
//die(header("Refresh:0"));
//die(header('Location:'.BASE_URL));
//$url = explode("#",$_SERVER['REQUEST_URI']);
//header('Location:'.$url[0]);
}
Why is your code putting the #register on the end of the URL at all?
If you are at the point of integrating general purpose registration/login code on a web page, the URL for that page determines what content should be displayed. A popup for an action like registering or logging-in is not the content of the page and shouldn’t change the URL.
The reason for redirecting to the exact same URL of the current page upon successful completion of post method form processing code is to prevent the browser from resubmitting the form data if that URL gets browsed back to or reloaded. If you change the url in any way when you perform this redirect, someone can walk up to a computer, open the browser and enter/navigate to the URL of the form page and use the browser’s developer tools, network tab, to see what the form data is.