468,780 Members | 2,254 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,780 developers. It's quick & easy.

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

Hi
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.

thanks
Sep 9 '07 #1
6 4644
kovik
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?

Thanks
Sep 9 '07 #3
pbmods
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
Hi
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?
Thanks
Sep 14 '07 #5
ak1dnar
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.

PHP

Expand|Select|Wrap|Line Numbers
  1. header('Location: http://www.thescripts.com');
  2.  
by adding this to your HTML head section, the current page will redirect after 5 secs to the specified location.
HTML
Expand|Select|Wrap|Line Numbers
  1. <meta http-equiv="refresh" content="5; url=result.php">
  2.  
Sep 14 '07 #6
pbmods
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 zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.