How to stop data copy ?
Collapse
X
-
Well im sorry i cant help anymore, id u dont know where to place this code then, you seriously dont know php at all
-
Ahhh come on! Why are you asking for questions when you don't have a clue what to do with the answer?!Originally posted by tejassoni View Postthanx buddy. But where place i add dis code ?
my site download file is load.php and file id is load.php?id=2352 etc.
This is the ultimate help for you: ULTIMATE HELPER :P
Leave a comment:
-
thanx buddy. But where place i add dis code ?
my site download file is load.php and file id is load.php?id=2352 etc.
Leave a comment:
-
Originally posted by GumSlone View Postnice code example,
but you need to extend it,
you should enable empty referrer,
also if the referrer url looks like this:it will be detected as a valid referrer by your code.HTML Code:http://another-domain.com/?bla.com
i understand you completely gumslone using ^ as negation sign will tell the script that the url must look like that from start
edited code
Added after 22 minutes:PHP Code:
<?php
$name = isset($_GET['name']) ? trim($_GET['name']) : null;
if($name===null)
{
die();
}
else
{
$ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ' ';
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ' ';
$pragma = isset($_SERVER['HTTP_PRAGMA']) ? $_SERVER['HTTP_PRAGMA'] : ' ';
if($ref!==' ' && preg_match("/^bla\.com/i", $ref) && preg_match("/^bla\.com/i", $host) && $pragma=='no-cache') // this should prevent it
{
if(file_exists("some_directory/$name"))
{
header("location:some_directory/$name");
exit;
}
else
{
die();
// kill file request file does not exists
}
}
}
?>
another way is to use object relation database
for example
creating an instance of a file each time it is request
so a table called
temp_downloads
file_name
file_path
exp_time
link
when user click download link
insert info into temp table
then generate a link to that file
PHP Code:
mysql_query("DELETE FROM temp_downloads WHERE exp_time<'".time()."'");
http://bla.com/file.php?link=jdhdjhgd
$link = isset($_GET['link']) ? mysql_real_escape_string(trim($_GET['link'])) : '';
$query = mysql_query("SELECT file_path FROM temp_downloads WHERE link='".$link."'");
if(mysql_num_rows($query)>0)
{
$file_object = mysql_fetch_object($query);
if(file_exists($file_object->file_path))
{
header("location:$file_object->file_path);
exit;
}
else
{
echo "file does not exists";
}
}
else
{
echo "link has expired";
}
after all this then u can pretty the url using rewrite engine
Code:RewriteEngine on RewriteRule ^file.php?link=([a-zA-z0-9]+)$? file/$1 [L]
Last edited by antony2kx; 08.01.12, 17:27.
Leave a comment:
-
nice code example,Originally posted by antony2kx View PostIt called hot link protection
there are several methods of doing this
1.
is to not use direct links for example
that could be http://bla.com/file.php?name=thebones.gif
or http://bla.com/file.php?id=1etc
this way you could check a number of things
if this is has not been lead to from your site (referer) then you could just kill the request for example
that example could be altered using a curl requestPHP Code:file.php
<?php
$name = isset($_GET['name']) ? trim($_GET['name']) : null;
if($name===null)
{
die();
}
else
{
if(isset($_SERVER['HTTP_REFERER']) && preg_match("/bla\.com/", $_SERVER['HTTP_REFERER']))
{
if(file_exists("some_directory/$name"))
{
header("location:some_directory/$name");
exit;
}
else
{
die();
// kill file request file does not exists
}
}
}
?>
so there are others ways
like using an md5 check some
generating a random key
like $session['key'] = uniqid(); //everytime someone visits the site //store this in datbase and then check upon file downloads
please use your head
but you need to extend it,
you should enable empty referrer,
also if the referrer url looks like this:it will be detected as a valid referrer by your code.HTML Code:http://another-domain.com/?bla.com
Leave a comment:
-
It called hot link protection
there are several methods of doing this
1.
is to not use direct links for example
that could be http://bla.com/file.php?name=thebones.gif
or http://bla.com/file.php?id=1etc
this way you could check a number of things
if this is has not been lead to from your site (referer) then you could just kill the request for example
that example could be altered using a curl requestPHP Code:file.php
<?php
$name = isset($_GET['name']) ? trim($_GET['name']) : null;
if($name===null)
{
die();
}
else
{
if(isset($_SERVER['HTTP_REFERER']) && preg_match("/bla\.com/", $_SERVER['HTTP_REFERER']))
{
if(file_exists("some_directory/$name"))
{
header("location:some_directory/$name");
exit;
}
else
{
die();
// kill file request file does not exists
}
}
}
?>
so there are others ways
like using an md5 check some
generating a random key
like $session['key'] = uniqid(); //everytime someone visits the site //store this in datbase and then check upon file downloads
please use your head
Leave a comment:
-
this one is only for texts and not for files, files can be easily renamed with grabbers.Originally posted by athora View Post
Leave a comment:
-
-
@dont use up words. And i knw .httaccss trick.
but it not working.
Leave a comment:
-
Abe Saale Ek File bana .htaccess Apne Root Folder me jaha Script rakhi hai
Aur Ye Code Paste kar de Uss me Aur Save kar dena
File Name Sshould be .htaccess
Code is :
ErrorDocument 404 Domain
Leave a comment:
-
i dont use direct links. But some people copy data from mass data copier.
now any soluction ?
Leave a comment:
-
If you provide direct links to files anybody can make a data copier. dont use direct links.
Leave a comment:
-
How to stop data copy ?
Frds some people has copy my site data. Now how to safe my site data from mass data copier script ?
plz buddy.
i knw that ek code aata he jo load.php me add krne ka hota he but i havnt that code.Tags: None
Leave a comment: