Здравствуйте! Сессии исчезают :( начинаю бегать по страницам и сессия не сохраняется
<?php
session_start();
echo session_id();
echo ' <a href="index.php?rem=11">1111</a><br><br><br><br>
<a href="index.php?rem=22">2222</a><br><br><br><br>
<a href="index.php?rem=33">3333</a><br><br><br><br>';
$rem = $_GET['rem'];
switch($rem)
{
case '11' :
$file = '1.php'; echo $file; include '1.php';
break;
case '22' :
$file = '2.php'; echo $file; include '2.php';
break;
case '33' :
$file = '3.php'; echo $file; include '3.php';
break;
default:
$file = '1.php';
echo $file;
break;
}
if (isset($_POST))
{
$name_send= substr(htmlspecialchars(trim($_POST['name'])), 0, 41);
$mail_send = substr(htmlspecialchars(trim($_POST['mail'])), 0, 41);
$test=$name_send;
}
function test()
{
global $test;
}
$_SESSION['star'] = $test;
echo "=========".$_SESSION['star']."=========";
printf('<form method="post" id="send_forum" name="sender" action="index.php" enctype="multipart/form-data" onsubmit="return SendForm();">
<div class="login01">
<div class="table104">
<div class="table101-tr">
<div class="cont04"><div class="inputstyle"><input oninput="formainp()" type="text" name="name" maxLength="40" value=".$text8."></div></div>
</div>
<div class="table101-tr">
<div class="cont04"><div class="inputstyle"><input oninput="formainp()" type="text" name="mail" maxLength="40" value=".$text8."></div></div>
</div>
<div class="table101-tr">
<div class="cont04"><div class="ccdlog"><a href=javascript:void OnClick=\'document.getElementById("send_forum").submit(); return false;\' class="ddottlog">{$text11}</a></div></div>
</div>
</div>
</div></form>');
?>
<?php
echo '11111111111111111111111111111111111';
echo "<a href='index.php'>index 11111</a><br><br><br><br>";
echo $_SESSION["star"];
?>