Page 1 of 1

Clicking on a button for limited times

Posted: Sun Jul 26, 2009 7:37 pm
by egturnkey
Hello dear friends ,

Consider we have a button where you should click

Is there anyone can help me and give the best idea how to make it limited

i means after 20 clicking on that button , it goes de-active / or / image / or / text for example says ( no more clicking )


Yes it could be very complex idea cause it may needs to recall a command at cronjob ( if i'm not wrong )



So the full story :-

i want a button that valid to be clicked 20 times per 24 hours , after the clicking 20 times , it gives msg says for example " come back 2morrow "


thanks in advance and i know it maybe hard and may takes time
but i really with that help , will open a new area into my mind



okay here is an simple example of


database.sql ( ip / time )
config.php ( connection to database )
index.php ( main functions )


download
---------

http://www.egcss.com/example.rar


but it didn't works cause i've still some error and really not able to understand where to put thay query

Code: Select all

$time = time();  
mysql_query("INSERT INTO `ip_table` (`ip`,`timestamp`) VALUES ('".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."',$time)");  
 
so can you please check out the example and fix it

Re: Clicking on a button for limited times

Posted: Mon Jul 27, 2009 10:25 am
by egturnkey
any help to fix that code

Re: Clicking on a button for limited times

Posted: Mon Jul 27, 2009 10:50 am
by pickle
Store the query in a variable first, then output that variable. Run the query on the command line to tweak it.

You can also add:

Code: Select all

or die(mysql_error());
to your query code to see exactly what the error is.