Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Unhappy automatically logout after given time and submit selected to database simutaneously

    i need help..i am beginner in php and trying to build a online exam system site.
    i have used cookie for login, now i wish that my content page(after login) having a start button and after clicking on that my "test.php" gets loaded and countdown stat..and after a given time page gets automatically logged out and answers stored in database simultaneously.
    anyone please help me..

    Thanks in advance..

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,462
    Thanks
    23
    Thanked 634 Times in 633 Posts
    I suggest you look into the Ajax Push Engine. http://www.ape-project.org/ Because you have to control things, but not in the browser so HTML or javascript is out of the picture. Doing the timing and closing the page needs to be done server side. You are also going to need good ajax understanding to do this.

    Maybe someone knows a simpler way to do this or you don't think the test takers know how to look at the html of their page or knows someone that does.

  • Users who have thanked sunfighter for this post:

    manupathak (10-26-2012)

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    thanks sunfighter..ok is that possible to store the time using time() in a variable when user click on "start test" and then just using "if condition" when difference of current time and that variable equal to my duration then go to logged out??

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,462
    Thanks
    23
    Thanked 634 Times in 633 Posts
    Yes, your method will work, but you will need a trigger to run the second part, getting the new time.
    I know little about APE, never used it, but the server side language is javascript. Js has two functions setInterval() - will execute another function, over and over again, at specified time intervals AND setTimeout() - executes a function, once.
    The variables sent to the about functions are the time of the interval in millisecs and the name of the function to execute.
    In other words, once started, say by the start button, no further input [trigger] is needed.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •