page2_form.php
php
<?php
//Session starts here
session_start();
?><!DOCTYPE HTML>
<html>
<BODY>
<head>
<title>Vícestránkový formulář</title>
<link rel="stylesheet" type="text/css" href="pokus.css">
</head>
<div class="container">
<div class="main">
<h2>IQ test 24</h2><hr/>
<span id="error">
<!----Initializing Session for errors--->
<?php
if (!empty($_SESSION['error'])) {
echo $_SESSION['error'];
unset($_SESSION['error']);
}
foreach ($_POST as $key => $value) {
$_SESSION['post'][$key] = $value;
}
?>
</span>
<form action="page3_form.php" method="post">
<?php
// Otazka 1
$pocetTabulek1 = 3;
$cisloTabulky1 = rand(1, $pocetTabulek1); // Vybira otazky od 1 do 3
$cestaKVybraneTabulce1 = sprintf('%s/qA01_%s.php', __DIR__, $cisloTabulky1);
include $cestaKVybraneTabulce1;
?>
<input type="reset" value="Reset" />
<input type="submit" value="Potvrď" />
</form>
</div>
</div>
</body>
</html>
Neformátovaný
Přidáno: 29.1.2017
Expirace: Neuvedeno