How to stop data copy ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • antony2kx
    replied
    Well im sorry i cant help anymore, id u dont know where to place this code then, you seriously dont know php at all

    Leave a comment:


  • arnage
    replied
    Originally posted by tejassoni View Post
    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.
    Ahhh come on! Why are you asking for questions when you don't have a clue what to do with the answer?!

    This is the ultimate help for you: ULTIMATE HELPER :P

    Leave a comment:


  • tejassoni
    replied
    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:


  • antony2kx
    replied
    Originally posted by GumSlone View Post
    nice code example,
    but you need to extend it,
    you should enable empty referrer,

    also if the referrer url looks like this:
    HTML Code:
    http://another-domain.com/?bla.com
    it will be detected as a valid referrer by your code.

    i understand you completely gumslone using ^ as negation sign will tell the script that the url must look like that from start


    edited code

    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
          
    }
       }

    }

    ?>
    Added after 22 minutes:

    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:


  • GumSlone
    replied
    Originally posted by antony2kx View Post
    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

    PHP 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
          
    }
       }

    }

    ?>
    that example could be altered using a curl request

    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
    nice code example,
    but you need to extend it,
    you should enable empty referrer,

    also if the referrer url looks like this:
    HTML Code:
    http://another-domain.com/?bla.com
    it will be detected as a valid referrer by your code.

    Leave a comment:


  • antony2kx
    replied
    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

    PHP 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
          
    }
       }

    }

    ?>
    that example could be altered using a curl request

    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:


  • GumSlone
    replied
    this one is only for texts and not for files, files can be easily renamed with grabbers.

    Leave a comment:


  • athora
    replied
    Copyscape Plagiarism Checker - Duplicate Content Detection Software

    Leave a comment:


  • GumSlone
    replied
    Originally posted by farukhbhai View Post
    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
    next time write your posts in English

    Leave a comment:


  • tejassoni
    replied
    @dont use up words. And i knw .httaccss trick.

    but it not working.

    Leave a comment:


  • farukhbhai
    replied
    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:


  • mFreak
    replied
    Could you suply us with your site url?

    Leave a comment:


  • tejassoni
    replied
    i dont use direct links. But some people copy data from mass data copier.

    now any soluction ?

    Leave a comment:


  • mFreak
    replied
    If you provide direct links to files anybody can make a data copier. dont use direct links.

    Leave a comment:


  • tejassoni
    started a topic How to stop data copy ?

    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.
Working...
X