view only once php block

wolfster

New Member
Messages
23
Reaction score
0
Points
0
hi all,
What I am after is a block or page (preferably the block) that displays only once per registered user.
I wish to start running little puzzle competitions on my site when i make it active.

the block should only be displayed to registered users and after a certain time period it should redirect to a different page, if the registered user tries to view the block again they should be redirected immediately bypassing the block so its no viewable again by that user..

I have very limited php experience and have not got a clue where to start...
Im using PHP Version5.2.12
and MySQL Version5.0.87

Im now off to do some research myself, just thought Id post here cos posts generally get an answer here where other php specailist sites posts sometimes get ignored...

TIA
Wolfster
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
If you do some more general research on php and build a login system you'll notice it's easy.
1. Check (in the database) whether the user can see the block.
2a. If allowed: display the block (*)
3a. Update the database
2b. If not allowed: display something else

(*) redirecting after a certain amount of time is possible in theory. In practice, you'll notice it won't always work. Two methods I can think of to redirect after a certain period are meta redirects and javascript, which both can be blocked by the client. Secondly, if you get redirected, you can just press "previous" and see the previous page... (although you might be able to fix that with some cache control headers)
 
Last edited:

daman371

New Member
Messages
130
Reaction score
0
Points
0
If you do some more general research on php and build a login system you'll notice it's easy.
1. Check (in the database) whether the user can see the block.
2a. If allowed: display the block (*)
3a. Update the database
2b. If not allowed: display something else

(*) redirecting after a certain amount of time is possible in theory. In practice, you'll notice it won't always work. Two methods I can think of to redirect after a certain period are meta redirects and javascript, which both can be blocked by the client. Secondly, if you get redirected, you can just press "previous" and see the previous page... (although you might be able to fix that with some cache control headers)

Pretty spot on.
 
Top