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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Expire session?

    hi

    how to get the time in session and how to expire it in a particular time using php for online exam site.please anybody reply me soon.

  • #2
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    Quickest (and dirtiest) solution would be pure XHTML in the HEAD section of your document:

    Code:
    <!-- redirect to whatever.html after 600 seconds -->
    <meta http-equiv="refresh" content="600;URL=http://www.yourdomain.com/whatever.html"></meta>
    Where whatever.html would display a "you've run out of time" message.

  • #3
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    Thanks for your reply.

    I tried your code. It works. But it doesn't work at the time of processing(i.e.)At the time of writing the examination. Do u have any idea regarding this.

  • #4
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    Could you explain what you mean? Perhaps post some code?

  • #5
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i am doing online exam site.if the user can login and write the exam.i planed to expire the test page in 10mins. if the time exceeds,user gets the time expired notice.this is my requirement.have you understand what i have to said?

  • #6
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    The code that mlse posted would do what you need. Although it can be disabled. Any solution for this can be however, so you might want to consider some sort of server side checks too (store page generated time, and check it when they hit submit).

    The correct element syntax would be (since it is empty):

    PHP Code:
    <meta http-equiv="refresh" content="600;URL=http://www.yourdomain.com/whatever.html" /> 

  • #7
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi,
    am working on one project. The project is of Online examination.
    Here i want to calculate the total time spent by user to perform the test and to display it on screen at the end of test.
    How do i calculate this time using PHP.
    So, plz can anybody help me to solve this issue.
    Thanx in advance!!!!


  •  

    Posting Permissions

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