zend framework - Standalone page navigation problems in php and browsers back button issue -
standalone page navigation problems mean in project have more 5 pages. user compulsory follow order navigate pages(page 1 -> page 2 -> page 3....). if user directly hits the page 3 redirecting 1st page. doing in page 1 when user clicks submit button self added variable session (usernamespace-> navpage = 'page 2')
and in page 2 checking
if(usernamespace-> navpage == 'page 2')
//nothing
else
redirecting page 1;
i have problem when in 3rd page user clicks browsers button not redirect 2nd page because usernamespace-> navpage == 'page 3' in history.
please suggest me change navigation's logic not related affected above browser issue.
make session data array, , set keys according pages completed:
//page1 $_session['pages']=[]; $_session['pages'][1]=true; //page2 if(!isset($_session['pages'][1]) //redirect $_session['pages'][2]=true; //page3 if(!isset($_session['pages'][2]) //redirect $_session['pages'][3]=true; //etc etc
Comments
Post a Comment