I know exactly what you're trying to do ( i run http://www.thunderarena.com
) secret links are really easy...what i do is this...
every link clicked gets put into a table (ip / userid clicked / etc.) this is mostly used so that when someone clicks someone elses link, it checks to see if their ip address has already clicked the userid's link...(and this table gets truncated at midnight in cron jobs)
also in the main database where all user information is kept are a couple columns to have, (clicks_today and total_clicks)...they both get +1 when someone clicks on the secret link(clicks_today gets reset to 0 at midnight), clicks_today is checked everytime someone clicks another player's link, so it's like...
- Code: Select all
$rowquery = mysql_query("SELECT * FROM `user_database` WHERE `userid`='$id'");
$row = mysql_fetch_array($rowquery);
if ($row[clicks_today] >= 500)
echo "This player has maxed their clicks for today";
echo "You have just clicked ".$row[username]."'s secret link";
mysql_query("UPDATE `user_database` SET `clicks_today`=clicks_today + 1, `total_clicks`=total_clicks + 1 WHERE `userid`='$id'") or die(mysql_error());
if you need anymore help just send me a pm