/    Sign up×
Community /Pin to ProfileBookmark

Post file submission time out.

I’m working a file upload database, each file can currently be submitted by anyone. Which i know how to change, so that only members can submit a file.
I want to tweak it a little more so that the user is only allowed to submit a maximum of 1 successful file every 5 minutes.

Can someone point me into a direction of an example, or website link to session timeout, if thats what this is called. I do not know what to call this, so i do not know how to look it up,

Thanks

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@ratcatemeAug 24.2008 — when you save a file to database with a unix timestamp then run a query like this
[code=php]
$result = mysql_query("SELECT * FROM uploads WHERE user = '{$username}' AND time < ".time()-5*60*60.";") or die(mysql_error());
if(mysql_num_rows($result == 0){
//do upload
}else{
echo "you uploaded a file within the last five minutes";
}[/code]


Scott.
×

Success!

Help @EliteGhost spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...