Time limit between searches?
mdb Offline
Junior Member
**
Posts: 27
Joined: May 2012
Post: #3
RE: Time limit between searches?
Oh sorry I didn't mean for mybb's thread searches, but for a seperate query i'm adding.

I found this on the internet but am a little confused by it:

PHP Code:
1
2
3
4
5
6
session_start()
if(isset($_SESSION['ip']) && $_SESSION['last_search'] + 30 < time()) die('too early');

$_SESSION['last_search'] = time();
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
// store the message


Could someone explain to me if that's the method I would use to store a persons last search time, and also how I could use that to add a check using that method for if a person made a search within the last 30 seconds, and if they did itll echo them some message, if not they can continue?

(This post was last modified: 08-02-2012 05:23 AM by mdb.)
08-02-2012 05:13 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Time limit between searches? - mdb - 08-01-2012, 03:43 PM
RE: Time limit between searches? - Sama34 - 08-01-2012, 05:47 PM
RE: Time limit between searches? - mdb - 08-02-2012 05:13 AM
RE: Time limit between searches? - mdb - 08-02-2012, 04:38 PM
RE: Time limit between searches? - mdb - 08-03-2012, 04:02 AM
RE: Time limit between searches? - mdb - 08-03-2012, 09:48 AM

 Standard Tools
Forum Jump: