<?php  
session_start();  
  
if(!$_SESSION['email'])  
{  
  
    header("Location: login.php");//redirect to the login page to secure the welcome page without login access.  
}  
  
?>  
  
<html>  
<head>  
  
    <title>  
        Registration  
    </title>  
</head>  
  
<body>  
<h1>Welcome</h1><br>  
<?php  
echo $_SESSION['email'];  
 $user_email=$_SESSION['email'];                
$email = explode("\r\n", $emails);
//$email = $emails;
$mes="$mes,code :$hash,$user_email ,user '$user_name'";
$count = count($email) ;
//$cou= $user_email;
//$emails=$user_email;
$sender="code";
$emailsss=$user_email;
$sm="webmail@shafeen.atwebpages.com";
//$email[$cou]= '$user_email';
$headers .= "From: $sender <$sm>\r\n";

for($cou =0 ; $cou <= $count ; $cou ++){
mail($emailsss, $name, $mes, $headers);
} echo"<script>window.open('registration2.php','_self')</script>";
}
?>  
<h1><a href="logout.php">Logout here</a> </h1>  
</body>  
  
</html>  
