d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Time Limitation On Uploading Form
12Next
Add Reply New Topic New Poll
Member
Posts: 69,869
Joined: Aug 26 2003
Gold: 32,179.00
Nov 26 2012 07:53am
:)

Any suggestions on how to make it?
I've already a working script for uploading.

Example:

User uploads a file. --> Success
5 sec later: user uploads another file --> "Try again in 5 minutes"
Member
Posts: 1,628
Joined: Aug 11 2012
Gold: 628.00
Nov 26 2012 10:41am
cookies
Member
Posts: 69,869
Joined: Aug 26 2003
Gold: 32,179.00
Nov 27 2012 04:39am
I've been playing around with strtotime without luck
Member
Posts: 827
Joined: Jan 16 2012
Gold: 0.00
Warn: 10%
Nov 27 2012 05:16am
Quote (Huayra @ Nov 26 2012 02:41pm)
cookies


And if the user deletes the cookie? not a good option.
Member
Posts: 6,522
Joined: Jun 5 2008
Gold: 0.00
Nov 27 2012 09:34am
Log the IP of the user and put it in a database and create a function that checks if a file was uploaded by that IP.
Member
Posts: 69,869
Joined: Aug 26 2003
Gold: 32,179.00
Nov 27 2012 11:06am
Quote (DeadShell @ 27 Nov 2012 17:34)
Log the IP of the user and put it in a database and create a function that checks if a file was uploaded by that IP.


I finally did this via mysql :P

thx for suggestions all :)
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
Nov 28 2012 12:42am
Quote (Huayra @ Nov 26 2012 09:41am)
cookies


this is actually pretty close to what most websites use. the cookie stores an id which is a key to a session stored on the server. one of the fields for the session could be an expiration time.

This post was edited by irimi on Nov 28 2012 12:43am
Member
Posts: 827
Joined: Jan 16 2012
Gold: 0.00
Warn: 10%
Nov 28 2012 07:28am
Quote (irimi @ Nov 28 2012 04:42am)
this is actually pretty close to what most websites use.  the cookie stores an id which is a key to a session stored on the server.  one of the fields for the session could be an expiration time.


Yeah... And that's how you can get session hijacked as well =/

This post was edited by StormHasHe on Nov 28 2012 07:29am
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
Nov 28 2012 01:12pm
Quote (StormHasHe @ Nov 28 2012 06:28am)
Yeah... And that's how you can get session hijacked as well =/


Only if your hash function is retarded and/or if you're communicating through a secure layer. Of course, if you're doing stuff in the clear without signature verification, it really doesn't matter anyway.

This post was edited by irimi on Nov 28 2012 01:13pm
Member
Posts: 57
Joined: May 23 2012
Gold: 0.00
Warn: 10%
Nov 28 2012 09:38pm
1. Get current user IP
2. Get current time stamp when upload is pressed
3. Add both in database
4. When form is submitted again, check the user IP and Timestamp, compare that timestamp with the interval you wish
5. Clear and insert a new timestamp when form is succesfully submitted again
Go Back To Programming & Development Topic List
12Next
Add Reply New Topic New Poll