anyhows i written this piece of code.. which reads the mode in the current URL,
and checks it with a sequence array to make sure you didnt jump the step before...
i know they could be certain loopholes here but.. after hours of coding my head is abit woozy.. can someone help me out and check the problems?
Code: Select all
<?php
//
$sequence = array(
'postjob'=>array('postjob','postjob2','postjob3','postjob4','postjob5','postjob6')
);
foreach ($sequence as $key=>$seq)
{
if (strpos($_GET['mode'],$key))
{
//start the sequence verification
for ($i = 0; $i < sizeof($seq); $i++)
{
//check for current mode
if ($_GET['mode']==$seq[$i])
{
//match your mode with the previous mode
if ($seq[$i-1] == $_SESSION['previous_mode'] AND $i > 0)
{
//if matched, continue
} elseif ($i > 0) {
//if not matched, but not first result
}
}
}
}
}
?>