Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Clicking on a button for limited times
Old 07-25-2009, 08:12 PM Clicking on a button for limited times
Novice Talker

Posts: 10
Trades: 0
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 per person ( IP ) , 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 day , per person ( IP ) after the clicking 20 times , it gives msg says for example " come back 2morrow "


It is 20 times per person per day
just like some downloading websites, when you downloads many files after for example 20 downloads it gives you msg " no more download for you today "
so it is yes as you've said 20 times per person per day

i've tried to find any script has such function so i can isolate the code but i didn't find any , so i hope if someone can help me about that , making it as simple as it could
thanks in advance

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

Last edited by egturnkey; 07-26-2009 at 05:12 AM..
egturnkey is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-26-2009, 05:14 AM Re: Clicking on a button for limited times
Experienced Talker

Posts: 41
Trades: 0
(assuming you can make a id for the person whos pressing the button)
<?PHP setcookie("user", $_POST[name], time()+86400, '/')

$user = $_COOKIE["user"];
$path = "$user.txt";
$handle = fopen($path, 'r') or die("can't open file");
$data= file_get_contents($path);

data= data++;
fclose($handle);


if ($data < 20){
<a href="directions/left.php"><img src="yes" alt="Left" name="down" width="50" height="50" id="left" />;
}
else{
<a href="directions/left.php"><img src="no" alt="Left" name="down" width="50" height="50" id="left" />;
}

$path = "$user.txt";
$handle = fopen($path, 'w') or die("can't open file");
fwrite ($path ,$data);

fclose($fh);

Last edited by flatrat; 07-26-2009 at 05:15 AM..
flatrat is offline
Reply With Quote
View Public Profile
 
Old 07-26-2009, 07:21 AM Re: Clicking on a button for limited times
Novice Talker

Posts: 10
Trades: 0
what a smart idea ...lol can't hold myself

it is very simple idea and not depending on database tables


thanks so much for this amazing idea

i will study every part of it , i like such smart idea
egturnkey is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Clicking on a button for limited times
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.39191 seconds with 12 queries