[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Webmasterplein.net • Toon onderwerp - Wachttijd na inklikken van button
Pagina 1 van 1

Wachttijd na inklikken van button

BerichtGeplaatst: 24 feb 2008 21:04
door Stefan
Hallo,

Ik probeer iets te maken in PHP. Het gaande om: Als je een button indrukt wordt er iets in de database gezet, bijvoorbeeld 10 punten extra. Maar alleen wil ik nu weten hoe ik bijvoorbeeld 80 seconde moet wachten voor ik weer op de button kan drukken.

Groet Steef 8-)

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 09:55
door libia
je zet in de db de time() van de laatste keer dat er op de knop is ingedrukt
in het php script controleer je dan of het verschil tussen time() en de tijd in de db groot genoeg is om nog een keer toe te voegen.

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 10:15
door Stefan

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 10:30
door libia
je moet het bij de userid een nieuw veld maken dan krijg je bijv.

users
------
id
name
password
clicked
test (dat veld van jou)

dan wordt de query zoiets:
mysql_query("UPDATE user SET test = test + ". $input." AND clicked = " . time() . " WHERE id = " . $id . " AND clicked < " . time()-$wachttijd);

moet je wel nog ff $wachttijd aanmaken.. en het is niet getest dus kijk maar of het werkt ;)

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 11:33
door Stefan

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 12:18
door libia

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 13:06
door Stefan
Ik heb het exact gekopieerd alleen hij zet de clicked niet in de database :? Er zit geen spelfout in, ik krijg alleen wel een error: http://steefkeijzer.gethost.nl/test/index2.php

Ik zie in ieder geval de fout niet! Alvast bedankt maar weer

Groet Steef 8-)

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 14:08
door libia
...syntax to use near '-10000' at line 1
oftewel er gaat iets fout bij time()-$wachttijd time() is op de een of andere manier 0..

kun je misschien echo time(); doen?

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 14:24
door Stefan
Echo time vanuit de database of de echo time();
:arrow: De echo time(); staat er al (vele cijfers!)

Groet Steef 8-)

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 14:25
door libia
oke, ik bedoelde die laatste..

kun je anders ff highlight_file('index2.php'); onderaan toevoegen?

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 14:41
door Stefan
Oke hij staat er: http://steefkeijzer.gethost.nl/test/index2.php

Leuk dat highlight, die kon ik nog niet.

Groet Steef 8-)

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 15:00
door libia

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 15:15
door Stefan
Er gaat wel 1 tel vanaf... :razz:

Alleen die error, die hoort toch nie zo?

Groet Steef 8-)

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 15:25
door libia

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 15:35
door Stefan

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 16:02
door Stefan
Volgens mij doet ie ut nu: http://www.steefkeijzer.gethost.nl/test/index2.php

Groet Steef 8-)

Re: Wachttijd na inklikken van button

BerichtGeplaatst: 25 feb 2008 16:12
door libia
mooi, nu moet je nog laten zien hoe lang het nog duurt totdat je weer mag klikken (tijd om weer te klikken - time() en denk aan de timestamp tool om het te converteren ;) )