0

I am initialising the session with the variable name fromSelectStudentPage to 1 when the button CONTINUE is clicked.

when i reload the page just for testing the session gets initialised to 1 even without calling the function.

<form id="forStudent">
     <button type="button" on-click="onSelectStudent();">CONTINUE</button>
</form>

function onSelectStudent() {
    if(checkStudType()) {
        <?php $_SESSION['fromSelectStudentPage'] = '1'; ?>
        $('form#forStudent').submit();  
    }
}
Joel
  • 11
  • This is the using of `SESSION`, for store data. – Mihai Alexandru-Ionut Jan 07 '17 at 11:55
  • 1
    Possible duplicate of [What is the difference between client-side and server-side programming?](http://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming) – user3942918 Jan 07 '17 at 11:56
  • No attached click event, no call (`on-click`). – Teemu Jan 07 '17 at 11:57
  • 1
    Mixing JS and Php. $_SESSION['fromSelectStudentPage'] will most likely equal 1, as Php will bypass your JS control structures. You could use a cookie, with value set with JS – Progrock Jan 07 '17 at 12:05

0 Answers0