help need for a secred link for a wargame

Links for php scripts

Moderators: macek, egami, gesf

weskuhh112
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Oct 07, 2004 1:37 pm
Contact:

help need for a secred link for a wargame

Postby weskuhh112 » Thu Oct 07, 2004 1:40 pm

i need an secred link for my wargame who can help me it must 500 clicks max on a day and you can click every day

who can help me?? :help: :help: :-D :-D :-D

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Thu Oct 07, 2004 2:04 pm

What are you talking about? Could you try maybe describing your situation more thoroughly, and with more punctuation?

weskuhh112
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Oct 07, 2004 1:37 pm
Contact:

Postby weskuhh112 » Sat Oct 09, 2004 10:38 am

i have a wargame and i need a secred link the clicks you know

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Sun Oct 10, 2004 8:51 pm

weskuhh112 wrote:i have a wargame and i need a secred link the clicks you know


No, I don't know. I have no idea what "a secred link the clicks" is. Please try to spend more than one sentence describing your situation. And more punctuation. What do you mean by "secret"? What "link" are you talking about? Whose "clicks" are you referring to?

weskuhh112
New php-forum User
New php-forum User
Posts: 3
Joined: Thu Oct 07, 2004 1:37 pm
Contact:

secred link

Postby weskuhh112 » Mon Oct 11, 2004 8:30 am

its a for instance http://www.darkwars.org/index.php?a=click&id=10571 click and you know what i mean 8)

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Mon Oct 11, 2004 9:43 am

Well..thats not really hard..
All you need to so is create a unique ID for your members... ten you should create a page that will process that id and check how many clicks are made per day.. that should be a peace of cake... and simply add a bit of logic.. If less then 500 click/if more than 500 clicks... number of clicks should be stored in the database and the last clcik date too... so when a person submits a query your script should check the last day... if the last click date is the same as today -- it should check number of clicks... if its not the same as todays date -- set the number to 0..
In any case the number of clicks should rise every time the link is clicked... you are also able to add a bit more logic and stop the counter if the number of clicks is 500..

For more information on how to use date function could be found here
http://se2.php.net/manual/en/function.date.php

Good luck?

User avatar
GostLy
New php-forum User
New php-forum User
Posts: 36
Joined: Mon Sep 13, 2004 5:47 am

Postby GostLy » Thu Oct 14, 2004 10:40 am

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";
}
else
{
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


Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest