Link to home
Start Free TrialLog in
Avatar of jrmajor
jrmajor

asked on

Controlling number of user searches

hi,

we are adding a php lookup/search feature on our website (lamp).  This feature searches against a single table in a mysql database.

What methods can I use to limit the number of searches performed by users over a period of time e.g. 10mins?  

thanks!
Avatar of JurgenvH
JurgenvH
Flag of Netherlands image

Do you have registered users who can search or can everybody search who visits the website?
In the last case you'd best track the seaches bij IP-address. Register the searches in a database.
Avatar of jrmajor
jrmajor

ASKER

my apologies for not adding this information!

no the feature will be available to all users i.e. there are no registered users.
Then probably the check on IP-address will be sufficient. It probably doesn't matter how many people download from the same computer, they can't work on it at the same time.
$_SERVER['REMOTE_ADDR'] gives you the IP-address, save this in the database with a download counter
Avatar of jrmajor

ASKER

ok so I would write the ip address to a table and have an autoincrement field to keep track of the number of searches.

what do you think would be best approach for checking the number of searches over a fixed period of time?
ASKER CERTIFIED SOLUTION
Avatar of JurgenvH
JurgenvH
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial