[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
aan alle goede dingen komt een eind, webmasterplein.net 2003 - 2013
wij danken jullie voor al mooie momenten die dankzij dit forum ontstonden - Derk, Rutger en Stef

Wachttijd na inklikken van button

Je komt er niet helemaal uit bij het scripten? Übergoede functie geschreven? Alles met betrekking tot scripting, kun je hier terecht.

Wachttijd na inklikken van button

Berichtdoor Stefan » 24 feb 2008 21:04

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-)
Opzoek naar een webdesigner? http://webtilize.net/
Avatar gebruiker
Stefan
wmpr
 
Berichten: 406
Geregistreerd: 27 dec 2007 14:08
Woonplaats: Ter Aar

Re: Wachttijd na inklikken van button

Berichtdoor libia » 25 feb 2008 09:55

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.
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Wachttijd na inklikken van button

Berichtdoor Stefan » 25 feb 2008 10:15

Opzoek naar een webdesigner? http://webtilize.net/
Avatar gebruiker
Stefan
wmpr
 
Berichten: 406
Geregistreerd: 27 dec 2007 14:08
Woonplaats: Ter Aar

Re: Wachttijd na inklikken van button

Berichtdoor libia » 25 feb 2008 10:30

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 ;)
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Wachttijd na inklikken van button

Berichtdoor Stefan » 25 feb 2008 11:33

Opzoek naar een webdesigner? http://webtilize.net/
Avatar gebruiker
Stefan
wmpr
 
Berichten: 406
Geregistreerd: 27 dec 2007 14:08
Woonplaats: Ter Aar

Re: Wachttijd na inklikken van button

Berichtdoor libia » 25 feb 2008 12:18

ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Wachttijd na inklikken van button

Berichtdoor Stefan » 25 feb 2008 13:06

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-)
Opzoek naar een webdesigner? http://webtilize.net/
Avatar gebruiker
Stefan
wmpr
 
Berichten: 406
Geregistreerd: 27 dec 2007 14:08
Woonplaats: Ter Aar

Re: Wachttijd na inklikken van button

Berichtdoor libia » 25 feb 2008 14:08

...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?
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Wachttijd na inklikken van button

Berichtdoor Stefan » 25 feb 2008 14:24

Echo time vanuit de database of de echo time();
:arrow: De echo time(); staat er al (vele cijfers!)

Groet Steef 8-)
Opzoek naar een webdesigner? http://webtilize.net/
Avatar gebruiker
Stefan
wmpr
 
Berichten: 406
Geregistreerd: 27 dec 2007 14:08
Woonplaats: Ter Aar

Re: Wachttijd na inklikken van button

Berichtdoor libia » 25 feb 2008 14:25

oke, ik bedoelde die laatste..

kun je anders ff highlight_file('index2.php'); onderaan toevoegen?
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Wachttijd na inklikken van button

Berichtdoor Stefan » 25 feb 2008 14:41

Oke hij staat er: http://steefkeijzer.gethost.nl/test/index2.php

Leuk dat highlight, die kon ik nog niet.

Groet Steef 8-)
Opzoek naar een webdesigner? http://webtilize.net/
Avatar gebruiker
Stefan
wmpr
 
Berichten: 406
Geregistreerd: 27 dec 2007 14:08
Woonplaats: Ter Aar

Re: Wachttijd na inklikken van button

Berichtdoor libia » 25 feb 2008 15:00

ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Wachttijd na inklikken van button

Berichtdoor Stefan » 25 feb 2008 15:15

Er gaat wel 1 tel vanaf... :razz:

Alleen die error, die hoort toch nie zo?

Groet Steef 8-)
Opzoek naar een webdesigner? http://webtilize.net/
Avatar gebruiker
Stefan
wmpr
 
Berichten: 406
Geregistreerd: 27 dec 2007 14:08
Woonplaats: Ter Aar

Re: Wachttijd na inklikken van button

Berichtdoor libia » 25 feb 2008 15:25

ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!

Re: Wachttijd na inklikken van button

Berichtdoor Stefan » 25 feb 2008 15:35

Opzoek naar een webdesigner? http://webtilize.net/
Avatar gebruiker
Stefan
wmpr
 
Berichten: 406
Geregistreerd: 27 dec 2007 14:08
Woonplaats: Ter Aar

Re: Wachttijd na inklikken van button

Berichtdoor Stefan » 25 feb 2008 16:02

Volgens mij doet ie ut nu: http://www.steefkeijzer.gethost.nl/test/index2.php

Groet Steef 8-)
Opzoek naar een webdesigner? http://webtilize.net/
Avatar gebruiker
Stefan
wmpr
 
Berichten: 406
Geregistreerd: 27 dec 2007 14:08
Woonplaats: Ter Aar

Re: Wachttijd na inklikken van button

Berichtdoor libia » 25 feb 2008 16:12

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 ;) )
ola, un cerveza por favor.


of
Avatar gebruiker
libia
wmpr
 
Berichten: 4149
Geregistreerd: 23 okt 2005 14:14
Woonplaats: Alphe!!


Keer terug naar PHP, ASP, SQL



cron