[b]code[/b]
<?php session_start();?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>if-sess_re</title>
</head>
<body>
<?php
if (isset($_SESSION['$mySession']))
{header("Location: http://www.isset.com/");
}
else
{header("Location: http://www.noset.com/");}
?>
</body>
</html>
[b]result[/b]
[B]Warning[/B]: Cannot modify header information -
headers already sent by (output started at if-session_redirect.php:11)
in if-session_redirect.php on line 13
The code above in http://dot.kr/x-test/if-session_redirect.php needs <?php session_start();?> because it should know session is already set or not yet.
But It should not used in header.
Then how can I make redirection in session condition?