I am having this problem, when someone enters the page that requires login, so the page will redirect the user to the login page, after the user completes login step, he/she should be redirected to previous page from he/she was redirected to login page.
Here is a condition on all login required pages:
<?php
session_start();
if(!isset($_SESSION['email'])) {
header("Location: login.php);
}
?>
What can I add to redirect the user to previous page after successful login?