You can't do it that way. PHP header must sent out before any content, so the correct order is:
header("location: login6.php");
echo "Please Log In First";
But these codes will redirect instantly and wouldn't let you see the content.
So I would do the redirection by JavaScript:
echo "Please Log In First";
echo "<script>setTimeout("location.href = 'http://www.example.com';",1500);</script>";
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…