Re: [PHP] Timer and submit button

2003-11-21 Thread David T-G
Frank --

...and then Frank Tudor said...
% 
% I am trying to create a timer tha would prevent someone from
% clicking submit until the timer reaches zero.

1) Javascript is your only hope to disable clicking through, as suggested
by the other responders.

2) It can still be defeated.  How important is it to keep them and why?

3) If you want a set amount of time you could just put in a refresh for
some length of time, but that would then whisk the page out from under
the surfer -- and you'd still have the problem of managing to come
through too early.

4) I can't think of any way you can reliably keep someone on a page for a
given time, but if you want to ensure that they can't go forward you
might make the next link require a magic key which you magically decode
to a time stamp (based on server time of course) some distance future
from when it was sent.  Note that this will require decryption as well as
encryption, since if the click didn't come in at exactly the right time
the server's encryption to check would be different and not just
"greater".


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Timer and submit button

2003-11-21 Thread RT
On Fri, 2003-11-21 at 10:51, Frank Tudor wrote:
> I am trying to create a timer tha would prevent someone from
> clicking submit until the timer reaches zero.
> 
> THe reason is to keep an individual on a page for a certain
> amount of time.
> 
> Does anyone know the best way to do this?
> 
> PHP?  Javascript?
> 
> Any examples?
> 
> Frank
> 
> __
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

Javascript only.
-- 
"I have a photographic memory. I just forgot the film" --Unknown
=
Ryan Thompson
[EMAIL PROTECTED]
http://osgw.sourceforge.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Timer and submit button

2003-11-21 Thread CPT John W. Holmes
From: "Frank Tudor" <[EMAIL PROTECTED]>

> I am trying to create a timer tha would prevent someone from
> clicking submit until the timer reaches zero.

JavaScript.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] timer problem

2003-02-22 Thread John W. Holmes
> Just a little curious. Is there any other way other than cron to do
> this. Is it possible to run a PHP script in an endless loop and when
the
> clock strikes, run another script?

Yeah, I think so, but it'd be worth the effort to just learn cron. You
can use set_time_limit() to zero and run your loop and do your stuff.
Not sure how that is for performance, though...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] timer problem

2003-02-22 Thread Siddharth Hegde
Just a little curious. Is there any other way other than cron to do
this. Is it possible to run a PHP script in an endless loop and when the
clock strikes, run another script?

- Sid

> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Saturday, February 22, 2003 9:40 PM
> To: 'Michael Gaab'; [EMAIL PROTECTED]
> Subject: RE: [PHP] timer problem
> 
> > i want to automate some activities by date.  on a certain date i
want
> to
> > do
> > some specific processing. the application is web based using apache.
i
> > guess
> > i would need some way of calling the program daily to see if "today
is
> the
> > day."  thread/daemon?  any suggestions appreciated.
> 
> Use cron  on *nix, or Task Scheduler if on Windows.
> 
> ---John W. Holmes...
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
> today. http://www.phparch.com/
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] timer problem

2003-02-22 Thread John W. Holmes
> i want to automate some activities by date.  on a certain date i want
to
> do
> some specific processing. the application is web based using apache. i
> guess
> i would need some way of calling the program daily to see if "today is
the
> day."  thread/daemon?  any suggestions appreciated.

Use cron  on *nix, or Task Scheduler if on Windows. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] timer on sessions?

2002-07-17 Thread Jas

I am not able to test from this machine so please tell me if I am right or
wrong on this:
$tmp = time();
$tme = time() - 5*60;
session_register('tmp');
if ($tmp >= $tme) {
echo 'Time has not reached 5 minutes, session still valid';
} else {
echo 'Timer has reached 5 minutes, you will need to log back in to
continue.'; }

"Asmodean" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> J> Not sure how to go about setting up a function to parse the date, hour,
> J> minutes, seconds, take the seconds and register them in a session var,
then
> J> do a check on the session var (seconds) vs. the seconds var + 5*60 (or
5
> J> minutes) to time out the session and force the user to log back in.  My
> J> problem is finding the correct way to check the seconds in php.  Any
help or
> J> pointers is appreciated.
> J> Jas
>
> time() will give you a UNIX timestamp. Use it to do the math.
>
> --
> Best regards,
>  Asmodeanmailto:[EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] timer on sessions?

2002-07-17 Thread Asmodean

J> Not sure how to go about setting up a function to parse the date, hour,
J> minutes, seconds, take the seconds and register them in a session var, then
J> do a check on the session var (seconds) vs. the seconds var + 5*60 (or 5
J> minutes) to time out the session and force the user to log back in.  My
J> problem is finding the correct way to check the seconds in php.  Any help or
J> pointers is appreciated.
J> Jas

time() will give you a UNIX timestamp. Use it to do the math.

-- 
Best regards,
 Asmodeanmailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Timer

2002-07-16 Thread Thomas \"omega\" Henning

How i know when 2 mins ellapsed?
"Kevin Stone" <[EMAIL PROTECTED]> wrote in message
013f01c22cee$b3e17110$6501a8c0@kevin">news:013f01c22cee$b3e17110$6501a8c0@kevin...
> Store a timestamp in a file.  When the bot is activated retrieve the old
> timestamp and calculate the difference between then and how.  Store that
> value in another file or database.  Update the file with a fresh
timestamp.
> -Kevin
>
> - Original Message -
> From: "Thomas "omega" Henning" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 16, 2002 11:22 AM
> Subject: [PHP] Timer
>
>
> > Is this possible:
> >
> > Im making a bot in PHP and i need a timer. Lets say noone ses anything
for
> > 2mins in the channel after that the bot ses something. And if the bot
> > recieves an msg the timer clears. Is this possible 2 be done?
> >
> > Thomas "omega" Henning
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] timer in PHP

2001-04-11 Thread Plutarck

I'm guessing it's either for a Quiz script or an Auction script.

If you want to make it easy on yourself, use a database to store the
starting time (when the timer "starts") and what time the test/auction
should end. When someome makes a submission, get the time stored in the
database and see if the person's submission is within the timelimit (check
if the current time is less than the finish time).

If the current time is within 2 minutes of the ending time, then take the
ending time, add 5 minutes to it, and then store it.

If you try to do this all in a sort of real-time, you're only making it hard
on yourself and it's more or less impossible to do (without killing yourself
in resources, anyway).

Doing it with a database, once you get it working in the first place, may
even be considered trivial. You may be pleasantly surprised...unless you
can't use a database :)


--
Plutarck
Should be working on something...
...but forgot what it was.


""george"" <[EMAIL PROTECTED]> wrote in message
9b1p05$t6c$[EMAIL PROTECTED]">news:9b1p05$t6c$[EMAIL PROTECTED]...
> I need to have a time running and after a certain time it will not allow
> you to submit anything else,  on top of that if someone makes an entry
with
> less than 2 minutes to go the time must be extended by 5 minutes.
>  I really am at a loss how to do this.
>  Can it be done.
>
> TIA
>
> George
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] timer in PHP

2001-04-11 Thread Chris Lee

there is no sure way, but using cookies/sessions you can make something that will 
*work* . assign the user a session_id, every time the user makes an entry add a value 
to the db, 

session_id = $SessionID
next_time = time() + 120

every time you make an entry, check to make sure that next_time < time() if it is then 
proceed, else update next_time = time + 300;

If you need a code example email me, I'll whip something up :)


-- 

 Chris Lee
 [EMAIL PROTECTED]



""george"" <[EMAIL PROTECTED]> wrote in message 
9b1p05$t6c$[EMAIL PROTECTED]">news:9b1p05$t6c$[EMAIL PROTECTED]...
I need to have a time running and after a certain time it will not allow
you to submit anything else,  on top of that if someone makes an entry with
less than 2 minutes to go the time must be extended by 5 minutes.
 I really am at a loss how to do this.
 Can it be done.

TIA

George



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]