List:General Discussion« Previous MessageNext Message »
From:Mark Kelly Date:March 10 2011 9:25pm
Subject:Re: How to protect primary key value on a web page?
View as plain text  
Hi.

On Thursday 10 Mar 2011 at 20:09 mos wrote:

[snip]

> Let's say I have a Document_Id column and the url is
> www.mydocuments.com/public?docid=4
> to retrieve document_id=4, I don't want someone to write a program to
> retrieve all of my public documents and download them. I want them to go
> through the user interface.

Leaving aside the silliness of making a document public then trying to stop 
people downloading it, there is at least one common solution available to you 
- Apache's mod_rewrite.

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

Obviously this is dependant on you running Apache, but it is a simple and 
common approach that will give you what you want.

You could also consider rate-limiting your application so that users who 
request too many pages for your tastes (indicating a possible program) are 
deliberately slowed down. Beware that this solution will likely have a 
detrimental effect on search engine spiders, and therefore your site rankings.

However, neither of these solutions are appropriate for discussion on a MySQL 
mailing list, and I agree with many of the other responses you have had - your 
plan to do this by changing your database is pointless and misdirected.

Cheers,

Mark
Thread
How to protect primary key value on a web page?mos10 Mar
  • Re: How to protect primary key value on a web page?Claudio Nanni10 Mar
    • Re: How to protect primary key value on a web page?mos10 Mar
      • Re: How to protect primary key value on a web page?Reindl Harald10 Mar
        • Re: How to protect primary key value on a web page?Claudio Nanni10 Mar
          • Re: How to protect primary key value on a web page?Reindl Harald10 Mar
      • Re: How to protect primary key value on a web page?Claudio Nanni10 Mar
      • Re: How to protect primary key value on a web page?Mark Kelly10 Mar
  • Re: How to protect primary key value on a web page?Reindl Harald10 Mar
    • Re: How to protect primary key value on a web page?Mike Diehl10 Mar
  • Re: How to protect primary key value on a web page?MySQL)10 Mar