-
Validating a multi page sessions form with php
I have tried every way but the correct way to figure this one out. I have a multi page sessions form and I have an inline validation script. I am trying to figure out how to combine the two. For the sake of saving space I will not post all my mistakes, but bellow are the two scripts. Any advice or pointers would be welcomed, thanks.
Multi form script:
<?php//Turn on sessions
session_start();//Find what stage to use
if (($_SERVER['REQUEST_METHOD'] == 'GET') || (!isset($_POST['stage'])))
{
$stage = 1;
}
else
{
$stage = (int) $_POST['stage'];
}// Save any submitted data
if ($stage > 1)
{
foreach ($_POST as $key => $value)
{
$_SESSION[$key] = $value;
}
}
if ($stage == 1)
{?>
Sorry, there were no replies found.