RSSAll Entries Tagged With: "javascript"

Image Protection Code using PHP | HTML | Javascript

Hai All ,

I implemented image protection in one of my latest work. Its pretty simple and effective so i am sharing with you.

Check out the demo and try the following :-

1. Try dragging the image to the Navigation Bar.

2. Right Click and Try viewing the image.

3. Take the source and click on the src of img tag.

Step 1 : Create a page named index.php

$page = $_REQUEST[‘p’];
if($page == ‘sImage’)  {  include(‘image.php’); }
else { echo ‘<img src="index.php?p=sImage" />’; }

Step 2 : Create a page named image.php

$imageName = "logo.jpg";
$img1 = imagecreatefromjpeg($imageName);
$img2 = imagejpeg( $img1 );

Note : You can save the image by right clicking -> Save Image as [ you can protect that too by disabling right click action using javascript :) ]

There are many other ways to hack the code. But this would save you from Newbies.

You are done !