i have this code which i am using to send an approval to a user email. what i need is : when the user clicks on the link; he should first login and then he can proceed the approval process. I tried the following code to check if the session is not registered,then to force the user to login (index.php):
global $user_ID;
$user_ID = $_SESSION['empName'];
if ($user_ID == '') {
header('Location: index.php'); exit();
}
echo "<INPUT type='hidden' name='Code' size = '6' value ='hr1.php' />";
if(isset($_POST['Code'])){$Code = $_POST['Code'];}
mysql_close($con);
now i need a method to redirect user to the previous page (link)
any ideas???