471,874 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,874 software developers and data experts.

Redirecting from a page after a certain amount of time has elapsed.

I am trying to write a PHP script such that the users are limited to a certain time to view the page.
And I would like to include a countdown timer as well in the page.
How can I do that?

I am using Apache and PHP5 with mysql in linux operating system.

Sep 9 '07 #1
6 4769
1,044 Expert 1GB
That sounds like a horrible idea. :P

Anyway, there's no way to really make that work because there are a million ways around it. You could limit them by session, but they can always start a new one. You can limit them with cookies, but they can always delete the cookie. You can limit them with JavaScript, but they can always press the back button.

Why would you want to do this?
Sep 9 '07 #2
Thanks for your response.

Actually, only logged in users are allowed to view the page. So maybe I can limit the time using "Sessions" as you said I could using sessions.

So, is there any hope?

Sep 9 '07 #3
5,821 Expert 4TB
Heya, shreedhan.

Are you looking to implement session timeout?

(once the above link expires, try running over to our Search page and look for 'session timeout' in the PHP forum)
Sep 9 '07 #4
I am trying to simulate an online test
And for that I need to redirect to results page after a certain limit of time
Is there anyway to do that?
Sep 14 '07 #5
1,584 Expert 1GB
How do you planing to redirect your web page to the result page. Is there any timer has setup with the application so far.
If you want to redirect the current page to another you can use headers.


Expand|Select|Wrap|Line Numbers
  1. header('Location: http://www.thescripts.com');
by adding this to your HTML head section, the current page will redirect after 5 secs to the specified location.
Expand|Select|Wrap|Line Numbers
  1. <meta http-equiv="refresh" content="5; url=result.php">
Sep 14 '07 #6
5,821 Expert 4TB
Merged duplicate threads.
Sep 14 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

15 posts views Thread by kpp9c | last post: by
2 posts views Thread by Paul L | last post: by
reply views Thread by Dynamo | last post: by
41 posts views Thread by amygdala | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.