Forum Moderators: coopster

Message Too Old, No Replies

Limiting number of database queries...

See it done in PHP, any way with MS-Access/ASP?

         

JayCee

7:11 pm on Mar 22, 2005 (gmt 0)

10+ Year Member



I'm a web developer/webmaster and do some limited database/ASP (VBscript) stuff and some SEO.

One of my clients has a new competitor. Their store locator stops you after 5 zip code queries ("..only 4 queries per week or 8 queries per month allowed.."). They are obviously using PHP.

My client wants me to do the same for our MS-Access/ASP (Dreamweaver MX 2004) store locator database, which now has no limitations on number of ZIP, City name or Phone Area searches.

My client is convinced this new competitor, with a new clone of client's product, got useful info on client's retail distribution strategy from our database.

We are on a Windows server (obviously) on a virtual shared hosting account. Not doing anything server-side at this point (except the search and results pages).

Can we also create such a query limitation without switching to MySQL and/or away from a Windows server?

Any ideas much appreciated!

--thanks!
(edited by jc for spelling)

jatar_k

7:41 pm on Mar 22, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I don't think you need to switch anything.

I would think for limiting you would need the person to have an account of some type. You could then count the number of searches and store them. This way you can compare against the max for each search.

JayCee

7:55 pm on Mar 22, 2005 (gmt 0)

10+ Year Member



Thanks, but this has to be easy/friendly for one-time web visitors looking to buy the product in a hurry.

They need to know if there is a retail store nearby or whether to order online. Nothing like a login should get in their way. That would have an unacceptable impact on sales.

We just want to stop people from searching many ZIP codes, etc. to try to copy chunks of our database.

jatar_k

10:14 pm on Mar 22, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well you need some way to tie it to the searcher.

or you could do a query per set time limit

or you could use IP

or you could use a session to track it

I understand the issue but if you absolutely want to limit each visitor to a set number of searches then you need to be able to identify them reliably

time limits will cause problems with a busy site

ip's overlap and change

sessions can be deleted

JayCee

10:47 pm on Mar 22, 2005 (gmt 0)

10+ Year Member



Yes, i agree that cookies are not a good solution and time limits may cause problems.

I expect that identity by IP is the best bet, even though it won't stop everyone. I don't know how to do this though, so i'm asking here (and for any ideas for methods beyond those 3).

I don't expect any method to give security as good as a password system, but do want to do something that will discourage abuse, while not discouraging shoppers.

jatar_k

12:28 am on Mar 23, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



store search by ip over time period I would guess

you can get the ip with $_SERVER['REMOTE_ADDR']

check your db for a record from a given time period
if it exists and it hasnt reached max allowed then update the count in that row by 1
if it does not exist insert a row with the count set to 1

I assume your table would be something like
ip
datetime
request_count

then you could clean up old rows by using the datetime field with a cron or something

just remember AOL users are great buyers and often they will al come in on the same ip

ironik

12:42 am on Mar 23, 2005 (gmt 0)

10+ Year Member



Since you'll have a hard time identifying a user uniquely by IP you can add the variable:

$_SERVER['HTTP_USER_AGENT']

then if you match against IP and user agent, you'll have a better chance of identifying the user. It probably won't help much since it's possible it'll still overlap... but should help (if you are using ASP there should be something similar to find the user agent + IP).