Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionIs it possible through WordPress (through a plugin, PHP or otherwise) to detect the IP of someone copying (ctrl+c) content on my website, and have that data sent/displayed to an admin?
Appreciate any assistance :)
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionIs it possible through WordPress (through a plugin, PHP or otherwise) to detect the IP of someone copying (ctrl+c) content on my website, and have that data sent/displayed to an admin?
Appreciate any assistance :)
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",
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.