Dari Serba Serbi Script Anti Hotlink Protection. Fantastis

Dari Serba Serbi Script Anti Hotlink Protection. Fantastis - Hallo sahabat Serba Ada, Pada Artikel yang anda baca kali ini dengan judul Dari Serba Serbi Script Anti Hotlink Protection. Fantastis, kami telah mempersiapkan artikel ini dengan baik untuk anda baca dan ambil informasi didalamnya. mudah-mudahan isi postingan Artikel Programing, yang kami tulis ini dapat anda pahami. baiklah, selamat membaca.

Judul : Dari Serba Serbi Script Anti Hotlink Protection. Fantastis
link : Dari Serba Serbi Script Anti Hotlink Protection. Fantastis

Baca juga


Dari Serba Serbi Script Anti Hotlink Protection. Fantastis


Hotlink protection biasanya cuma cek validasi referer, kalau host referer gak cocok ama host server maka gambar tidak akan mau nungul.
ini script untuk memanipulasi http header referernya tersebut




<?php
error_reporting(0);
/*
anti hotlink protection by ogah
http://ogah.gw.lt
*/
$agen = urldecode($_SERVER['HTTP_USER_AGENT']);
$headernya = array ('Accept-Language: en-us,en;q=0.7', 'Accept: text/xml,text/javascript,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5');

if(isset($_GET['u'])) {
$url = 'http://';
$url .= $_GET['u'];

$file = explode('/', $url);
$tipe = end($file);
$tipe = explode('.', $tipe);
$ext = end($tipe);

$refer = 'Referer: '.$url;
array_push($headernya, $refer);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $agen);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headernya);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$salin = curl_exec($ch);
curl_close($ch);

if($ext == 'png') {
header("Content-Type: image/png");
}
elseif($ext == 'jpg') {
header("Content-Type: image/jpg");
}
else {
header("Content-Type: image/gif");
}
echo $salin; exit;
}
?>
 
simpan sebagai file img.php cara penggunaan: misal scriptnya kamu simpan sebagai hxxp://domainmu.com/img.php dan gambar yang diproteksi hotlink adalah hxxp://anu.com/images/gambarku.gif untuk mengelabuhi proteksinya gunakan hxxp://domainmu.com/img.php?u=anu.com/images/gambarku.gif atau dalam tag htmlnya Code:

<img src="hxxp://domainmu.com/img.php?u=anu.com/images/gambarku.gif" alt="anu"/>


Demikianlah Artikel Dari Serba Serbi Script Anti Hotlink Protection. Fantastis

Sekianlah artikel Dari Serba Serbi Script Anti Hotlink Protection. Fantastis kali ini, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sampai jumpa di postingan artikel lainnya.

Anda sekarang membaca artikel Dari Serba Serbi Script Anti Hotlink Protection. Fantastis dengan alamat link https://fantastissekali.blogspot.com/2014/06/dari-serba-serbi-script-anti-hotlink.html

0 Response to "Dari Serba Serbi Script Anti Hotlink Protection. Fantastis"

Post a Comment