Getting to know who uses my scripts... and Database use...
Posted: Fri Dec 06, 2002 7:26 pm
Hi all,
I'm working on a project where I neeed to protect as much as possible other websites from linking directly to photos we're trying to sell.
My idea is to use a simple script to display the photos using the GD libraries or a direct feed from a DB (I'm not deceided on that yet). My thinking was to check who was requesting the script and disply the photo only if the request came from our site or one of our trusted member. If the request comes from somewhere else we would display some sort of obsenity to discourage that practice.
We don't want direct linkage because, in general, the site doing that do not send proper credit back to us and it uses our bandwidth instead of theirs...
OK about how I was thinking of checking who requests the script was by using one of the values from _$SERVER. My problem is that I have no idea which one to use...
Any idea?
Also about the direct feed from the database thing... I was thinking going one of 2 ways to protect our photos.
1) place the photos outside the web server paths, no one can access them from the web but PHP can still manipulate the photos.
2) store the photos directly in a MySQL database.
The photos will range from 50Kb to 250Kb.
I see advantages for both ways. The first is easier to use and less asle on the DB but deleting the photos is not automatic when droping a particular set from the Database (descriptions, filename and such).
The latter provides easier management but will ask more from the Database.
My question here is when calculating DB result speed does the size of each record count or simply the number of rows to sift through?
Sorry if this is a little long and I appreciate all the help you can offer.
Puckeye
I'm working on a project where I neeed to protect as much as possible other websites from linking directly to photos we're trying to sell.
My idea is to use a simple script to display the photos using the GD libraries or a direct feed from a DB (I'm not deceided on that yet). My thinking was to check who was requesting the script and disply the photo only if the request came from our site or one of our trusted member. If the request comes from somewhere else we would display some sort of obsenity to discourage that practice.
We don't want direct linkage because, in general, the site doing that do not send proper credit back to us and it uses our bandwidth instead of theirs...
OK about how I was thinking of checking who requests the script was by using one of the values from _$SERVER. My problem is that I have no idea which one to use...
Any idea?
Also about the direct feed from the database thing... I was thinking going one of 2 ways to protect our photos.
1) place the photos outside the web server paths, no one can access them from the web but PHP can still manipulate the photos.
2) store the photos directly in a MySQL database.
The photos will range from 50Kb to 250Kb.
I see advantages for both ways. The first is easier to use and less asle on the DB but deleting the photos is not automatic when droping a particular set from the Database (descriptions, filename and such).
The latter provides easier management but will ask more from the Database.
My question here is when calculating DB result speed does the size of each record count or simply the number of rows to sift through?
Sorry if this is a little long and I appreciate all the help you can offer.
Puckeye