Detecting IP Address of someone using ‘copy’ function [closed]

Here is a road map to do this. You should adjust this code to your exact requirements:

You can detect copy event in JavaScript using this code in your page

<script>

   jQuery(document).ready( function($) {
       function myFunction() {
          // here make an ajax call to send data to server
          $.ajax({
              url: "http://yourwebsite.com",
              type: 'POST',
              data: {'copied': true}
          });
      }
   });

</script>

and replacing <body> tag of the page to something like this

<body oncopy="myFunction()">

Note: The oncopy event may not work as expected in some browsers when trying to copy an image.

On server side yo can easily get IP of someone copying content on your website, and have that data saved somewhere for display.

function ajax_callback_function( ) {

    if ( isset($_POST['copied']) ) {

        $User_IP   = $_SERVER['REMOTE_ADDR']; // Get User IP

        // Here goes the code to save $User_IP somewhere in db
        ....
        ....

    }

    return "";
}

I hope this helps.