Guys,
Please help me. I am testing something. I have 3 fill in fields and on page 3 I want to show all the results. Im trying to remind the result in sessions, but is only saves the last one. Can you please help me how to save the variables in the session? Underhere my script:
<?php
session_start();
$SESSION['paginanummer'] == '0';
if (isset($POST['getal1']))$SESSION['$getal1'] = $POST['getal1'];
if (isset($POST['getal2']))$SESSION['$getal2'] = $POST['getal2'];
if (isset($POST['getal3']))$SESSION['$getal3'] = $POST['getal3'];
?>
<html>
<head>
<title>*******</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>
<body>
<table align="center" border="0" class="table" cellpadding="0" cellspacing="0" width="705px">
<tr>
<td colspan="2" style="background-image: url(img/i_header_02.jpg)" width="705" height="146">
<h3>FSD Marktplaats: Kennis, vakgenoten en inspiratie</h3></td>
</tr>
<tr>
<td style="background-image: url(img/i_nav_top.gif)" width="225" height="40"></td>
<td class="header" width="480px">Inschrijven</td>
</tr>
<tr>
<td class="menu" valign="top"><?php include('menu.html') ?>
<label class="footer">© 2008, <a href="****" target="_blank">****</a></label></td>
<td class="content" valign="top">
<form action="<?php ($_SERVER['PHP_SELF']) ?>" name="formulier" method="post">
<?php
switch($_SESSION['paginanummer'])
{
case '1':
{
echo "Welkom op pagina 1<br /><br />";
$_SESSION['paginanummer'] = '2';
echo "".$getal1."";
?>
Graag alle velden invullen!<br /><br />
<input id="input2" type="text" name="getal2" /><br /><br />
<input class="inschrijven" type="submit" name="inschrijven2" value="Inschrijven" />
<?php
}
break;
case '2':
{
echo "Welkom op pagina 2<br /><br />";
$_SESSION['paginanummer'] = '3';
echo "".$getal2."";
?>
Graag alle velden invullen!<br /><br />
<input id="input2" type="text" name="getal3" /><br /><br />
<input class="inschrijven" type="submit" name="inschrijven3" value="Inschrijven" />
<?php
}
break;
case '3':
{
echo "Welkom op pagina 3<br /><br />";
$_SESSION['paginanummer'] = '0';
echo "".$getal1."<br />";
echo "".$getal2."<br />";
echo "".$getal3."";
?>
Graag alle velden invullen!<br /><br />
<input id="input2" type="text" name="getal4" /><br /><br />
<input class="inschrijven" type="submit" name="inschrijven4" value="Inschrijven" />
<?php
}
break;
default:
{
$_SESSION['paginanummer'] = '1';
?>
<input id="input2" type="text" name="getal1" /><br /><br />
<input class="inschrijven" type="submit" name="inschrijven" value="Inschrijven" />
<?php
}
}
?>
</form>
</td>
</tr>
</table>
</body>
</html>