logo

PHP Script Lisans Mekanizması

logo

Arkadaşlar size kendi geliştirdiğim basit bir PHP Script lisanslama mekanizması anlatacağım. Kendi basit scriptlerimde de kulalndığım bu mekanizma ile bir dosyayı sadece bir kez şifreleyerek herkese dağıtabilecek/istemediklerinize lisanssız kullanımı engelleyecek konuma getirebilirsiniz…

Şifrelemek için size önerim ioncube encoder ın web versiyonudur. Bugüne Kadar Kırılamadı, ayrıca web şifrelemesi sayesinde yazılımı satın almadan düşük bir masraf ile (1 dolar bile değil 50 sent kadarcık :) ) scriptinizi herkes için lisanslayabilirsiniz. (dipnot: şifrelenen dosya ftp den binary (ikilik) gönderme seçeneği seçilerek yollanmalıdır)

Nasıl Oluyor?
Bunun ana mantığı basit. Uptime ı yüksek güvenli bir sunucuya (tavsiyem googlepages )bir text dosyası atacaksınız, o text dosyasında da satır satır lisanslanmış site adresleri olacak, scriptinize ekleyeceğiniz basit bir kod ile o satırları okutup alan adının o dizi içerisinde olup olmadığını kontrol ettirtecek, değilse de lisanssız kullanım ile scxript çalışmasını engelleyeceksiniz ;)

Gelelim Kodlamaya
ilk önce bir text dosyası oluşturmalısınız: bu text dosyasında scripti lisansladığınız/yani kullanılmasına izin verdiğiniz alan adlarının listesi olmalı, ama sadece siteadi.com şeklinde
örnek text dosyası:

1
2
3
4
5
6
siteadi.com
foobar.com
soulsmasher.net
soulsmasher.com
soulsmasher.org
phpfusion-tr.com

gibi

şimdi ise bir php dosyası hazırlıyoruz, işin sırrı burada aslında :) bu php dosyası scriptinizde her sayfaya require yada incldue edilmelidir. size önerim her sayfada çağrılan bir dosya (mesela config.php gibi) bir dosyaya yüklemenizdir.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
//PHP Lisanslama Scripti 1.0
//Kodlama: Arda Kılıçdağı (SoulSmasher)  ©2008
//http://www.soulsmasher.net
/*-----------------------------------------------------------------
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+----------------------------------------------------------------*/
 
 
//Eğer bu scripti kullandıysanız en azından bana düşüncelerinizi bildirmeniz beni gerçekten memnun edecektir :)
 
//AYARLAR KISMI
$cekilecek_text="http://www.site.com/cekilecek_text_dosyasi.txt"; //bir sunucuya yüklediğiniz lisanslanmasına izin veridğiniz alan adlarının olduğu text dosyası, tavsiyem googlepages.com gibi 24 saat açık olmasına güvenilir bir sunucuya yüklemenizdir
//AYARLAR KISMI BİTTİ
 
//NE YAPTIĞINIZI BİLMİYORSANIZ AŞAĞISINA DOKANMAYIN
if (!function_exists("file")) { die("<strong><a href='http://www.php.net/file'>file</a></strong> fonksiyonu sunucuda yüklü olmalıdır<br /> fonction <strong><a href='http://www.php.net/file'>file</a></strong> must be installed on the server"); } //file fonksiyonu yüklü değilse lisans scripti çalışmaz :)
function soullisanskontrol() {
	if (substr($_SERVER['HTTP_HOST'], 0, 4) == "www.") { //alan adı değişkeni bazı sunucularda www ile başlıyor bazılarında www. suz ondan böyle bir değişkene ihtiyac var
	$domainadi = substr($_SERVER['HTTP_HOST'], 4);
	} else {
	$domainadi = $_SERVER['HTTP_HOST'];
	}
return $domainadi;
}
$alanadi=soullisanskontrol();//yormasın her seferinde 1 kez buffera alalım yeter
 
$lisanstext=file($cekilecek_text,FILE_IGNORE_NEW_LINES); //yüklediğiniz text dosyasının adresi
$lisans=array();//boş dizi oluşturduk önce yeni oluşacak kontrol dizisi için
 
 
foreach($lisanstext as $sayi => $cekveri) {
$lisans[$sayi]=rtrim($cekveri,"\r\n"); //bazen windows tabanlı metin editörlerinde yazılan metinler ve linux üzerindeki editörelerde yazılan metinlerinm sonundaki yeni satıra geçme kodları aynı olamayabiliyor. bu sebeple işi sağlama alıp onların temizlendiği yeni bir dizi oluşturuyoruzs
}
 
if (!in_array($alanadi,$lisans)) { 
die("Lisanssız Kullanım: ".$alanadi."<br /> Unlicensed Usage ".$alanadi); exit; //alan adı bizim dizimizde yoksa die() fonksiyonu ile siteyi kilitliyor, buraya kendi fonksiyonunuzu/nasıl çalışacağını yazabilirsiniz
} 
 
?>

bunu gömdüğünüz dosyayı da ioncube ile şifrelerseniz artık scriptiniz lisanslanmaya hazır :)

kolay gelsin ;)

VN:F [1.9.3_1094]
Rating: 8.8/10 (17 votes cast)
VN:F [1.9.3_1094]
Rating: +3 (from 3 votes)
PHP Script Lisans Mekanizması, 8.8 out of 10 based on 17 ratings
  • Volkan
    Teşekkürler. ellerine sağlık :)
  • peki birşey soracağım, Ücretle satılan wordpress temalarının çoğaltılamaması için bu işlemi nasıl wordpress temasının içine entegre edeceğiz
  • SoulSmasher
    Temanın herhangi php dosyalarına (mesela header.php) bu kodları eklemeniz yeterli olacaktır
  • Hasan Can OZKAN
    Merhaba, kendi localhostumda odbc tabanlı bir scriptimi lisanslamak istedim fakat verdiğim ip lisansi (127.0.0.1,localhost) script calısmıyor. Hata veriyor

    Fatal error: Cannot redeclare soullisanskontrol() (previously declared in C:\AppServ\www\sevenpanel\lisans.php:21) in C:\AppServ\www\sevenpanel\lisans.php on line 27
  • SoulSmasher
    Hi there,
    My name is Michael

    I have developed a software that automatically
    places your ad on millions of blogs.

    You will receive thousands of targeted hits to
    your website as Blog Blaster places your ad on
    blogs that match your ad's category.

    This method has never been released to the public
    before. Very few, if anyone has implemented this.


    http://www.promote-bz.net/1/blogblaster/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    No Matter what you are selling - Hit-Booster will send targeted
    visitors to your website!

    Within 15 minutes you will have your own website
    traffic generator that will bring in an ever increasing
    amount of hits to your websites! Automatically

    This software is perfect for bringing real traffic to
    your site... even if... it's an affiliate link where you
    have no control over the website content!


    http://www.promote-bz.net/1/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    How would you like to make 75 - 250
    every single day just for clicking your mouse?

    Start earning Minutes from now!

    Don't believe any hyped promises - you won't
    be making thousands of dollars every day and
    you won't be a millionaire by next year but
    my System is a surefire method for everyone
    who wants to start earning online.


    http://www.promote-bz.net/cashcreation/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    We're excited to let you know that Arda Kilicdagi has invited you to Dropbox!

    Arda Kilicdagi has been using Dropbox to sync and share files online and across computers, and thought you might want it too.

    Visit http://www.dropbox.com/link/20.bAD3INO8wJ/NjIxOTc5NDk1Nw to get started.

    - The Dropbox Team

    ____________________________________________________
    To stop receiving invites from Dropbox, please go to http://www.dropbox.com/bl/a91658153b25/notifications-zakn0qgnlv%40disqus.net
  • SoulSmasher
    Merhaba, sebebi soullisanskontrol fonksiyonun 2 kere tanımlanmış olması.
    fonksiyonu şöyle ekleyin:
    if (!function_exists("soullisanskontrol")) {
    fonksiyon kodları buraya
    }
  • hemogram
    çalıştıramadım config dosyasının içie koydum site beyaz boş sayfa olarak çıkıyor nedendir
  • SoulSmasher
    Hi there,
    My name is Michael

    I have developed a software that automatically
    places your ad on millions of blogs.

    You will receive thousands of targeted hits to
    your website as Blog Blaster places your ad on
    blogs that match your ad's category.

    This method has never been released to the public
    before. Very few, if anyone has implemented this.


    http://www.promote-bz.net/1/blogblaster/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    No Matter what you are selling - Hit-Booster will send targeted
    visitors to your website!

    Within 15 minutes you will have your own website
    traffic generator that will bring in an ever increasing
    amount of hits to your websites! Automatically

    This software is perfect for bringing real traffic to
    your site... even if... it's an affiliate link where you
    have no control over the website content!


    http://www.promote-bz.net/1/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    How would you like to make 75 - 250
    every single day just for clicking your mouse?

    Start earning Minutes from now!

    Don't believe any hyped promises - you won't
    be making thousands of dollars every day and
    you won't be a millionaire by next year but
    my System is a surefire method for everyone
    who wants to start earning online.


    http://www.promote-bz.net/cashcreation/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    We're excited to let you know that Arda Kilicdagi has invited you to Dropbox!

    Arda Kilicdagi has been using Dropbox to sync and share files online and across computers, and thought you might want it too.

    Visit http://www.dropbox.com/link/20.lDBoQ4t7NN/NjIxOTc5MzgxNw to get started.

    - The Dropbox Team

    ____________________________________________________
    To stop receiving invites from Dropbox, please go to http://www.dropbox.com/bl/badea0212506/notifications-lu7umqn54o%40disqus.net
  • SoulSmasher
    Çekilecek text değişkenini düzgün ayarlamalısınız, ve de hostunuzda allow_url_fopen ayarı aktif olmalıdır.
  • carizmali
    süper ötesisiniz bende bunu arıyordum işte :D
  • SoulSmasher
    Hi there,
    My name is Michael

    I have developed a software that automatically
    places your ad on millions of blogs.

    You will receive thousands of targeted hits to
    your website as Blog Blaster places your ad on
    blogs that match your ad's category.

    This method has never been released to the public
    before. Very few, if anyone has implemented this.


    http://www.promote-bz.net/1/blogblaster/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    No Matter what you are selling - Hit-Booster will send targeted
    visitors to your website!

    Within 15 minutes you will have your own website
    traffic generator that will bring in an ever increasing
    amount of hits to your websites! Automatically

    This software is perfect for bringing real traffic to
    your site... even if... it's an affiliate link where you
    have no control over the website content!


    http://www.promote-bz.net/1/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    How would you like to make 75 - 250
    every single day just for clicking your mouse?

    Start earning Minutes from now!

    Don't believe any hyped promises - you won't
    be making thousands of dollars every day and
    you won't be a millionaire by next year but
    my System is a surefire method for everyone
    who wants to start earning online.


    http://www.promote-bz.net/cashcreation/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    We're excited to let you know that Arda Kilicdagi has invited you to Dropbox!

    Arda Kilicdagi has been using Dropbox to sync and share files online and across computers, and thought you might want it too.

    Visit http://www.dropbox.com/link/20.lR8v-oGUsv/NjIxOTc5NTQ1Nw to get started.

    - The Dropbox Team

    ____________________________________________________
    To stop receiving invites from Dropbox, please go to http://www.dropbox.com/bl/55bdd32b06da/notifications-5wc0echsok%40disqus.net
  • burak
    Güzel metin
  • SoulSmasher
    Teşekkürler :)
  • ahmet
    hem txt hemde config. php gibi önemli bir dosyaya yukardaki kodu ekledikten sonra şifreleyip server a atsak. Sorun çıkarırmı ?

    ben txt dosyasınında şifrelenip, karşı tarafta kalmasını istiyorum.
  • SoulSmasher
    Hi there,
    My name is Michael

    I have developed a software that automatically
    places your ad on millions of blogs.

    You will receive thousands of targeted hits to
    your website as Blog Blaster places your ad on
    blogs that match your ad's category.

    This method has never been released to the public
    before. Very few, if anyone has implemented this.


    http://www.promote-bz.net/1/blogblaster/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    No Matter what you are selling - Hit-Booster will send targeted
    visitors to your website!

    Within 15 minutes you will have your own website
    traffic generator that will bring in an ever increasing
    amount of hits to your websites! Automatically

    This software is perfect for bringing real traffic to
    your site... even if... it's an affiliate link where you
    have no control over the website content!


    http://www.promote-bz.net/1/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    How would you like to make 75 - 250
    every single day just for clicking your mouse?

    Start earning Minutes from now!

    Don't believe any hyped promises - you won't
    be making thousands of dollars every day and
    you won't be a millionaire by next year but
    my System is a surefire method for everyone
    who wants to start earning online.


    http://www.promote-bz.net/cashcreation/











    Remove link:
    http://www.promote-bz.net/remove/

    Contact us:
    http://www.promote-bz.net/contact/
  • SoulSmasher
    We're excited to let you know that Arda Kilicdagi has invited you to Dropbox!

    Arda Kilicdagi has been using Dropbox to sync and share files online and across computers, and thought you might want it too.

    Visit http://www.dropbox.com/link/20.Ag6xu1zHYy/NjIxOTc5Njc3Nw to get started.

    - The Dropbox Team

    ____________________________________________________
    To stop receiving invites from Dropbox, please go to http://www.dropbox.com/bl/8bd57fcf3bbd/notifications-630m0dbnm7%40disqus.net
  • bu güne kadar kırılmadı demişiniz ama ruslar 5$ gibi ufak bir meblaya kırıyorlar :(

    yinede paylaşım için teşekkürler
  • zend o, ioncube değil, dezender adlı yazılım ile kırıyorlar, ulaşılması zor şeyler değil yani. kaldı ki eski sürümleri için o. en yeni ioncube henüz kırılamadı, bir şekilde kırılırsa bile ioncube web encoder de otomatik olarak güncelleneceğinden sorun olmayacaktır.
  • Merhabalar,

    Arda kardeşimin yazmış olduğu makaleyi bende kendime özümseyip bloğumda yayınlamıştım. Kaynak olarak belirtmeyi de unutmuştum. Kaynak belirterek yayına yeniden soktum. Kendisine teşekkür ederim. Bir çok yazılımımda bu lisansı kullanıyorum.

    lisans.txt dosyanıza

    localhost
    127.0.0.1
    10.0.0.2

    olarak ekleyin. ayrıca kodları başka bir php kod satırı arasına koymayın.

    Soulmaster dan alıntı yazım :
    http://blog.aytacengin.com/script-lisansi-nasil-yazilir-php
  • Teşekkürler :)
  • quastram
    txt dosyasına sitenin linkini yazsam da hala lisanssız kullanım diyor. Sorun ne olabilir acaba.
  • site linkini nasıl yazdınız? ayrıca file() fonksiynu bazı sunucularda güvenlik sebebi ile dışardan link çekimini engellemekte. bunları kontrol edin
  • Çağrı
    İsterseniz kendi hostinginize yükledikten sonra uptime sorunu çözmek için eğer txt dosyası boşsa lisanslı olarakta gösterebilirsiniz.
  • administro
    Arkadaşlar bunu kullananlarınız varsa; Demomudur, 1 süre sonra programı alamamız gerekirmi? Teşekkürler
  • demo değil ücretsiz, fakat içindeki comment kodları silinmemelidir,
    ayrıca işinize yaradıysa ufak da olsa bağış yapmanız beni çok mutlu edecektir :)
  • @asdcan
    file() fonksiyonun açık olması ve de uzaktan dosya çekebilecek halde izinlendirilmesi yeterlidir
  • asdcan
    yani sunucumuzda file() ya da file_get_contents()fonkiyonlarından birisi açık olmalı değil mi?
    Birde sadece bu dosyayı her sayfadan çağrılan bir dosyaya gömdüğümüzde başka yapmamız gereken birşey kalmıyor.Doğru anlamışmıyım?
    Böyle lisanssız kullanıldığında sayfada:
    Lisanssız Kullanım: www.lisansihlaliyapansite.com
    Unlicensed Usage : www.lisansihlaliyapansite.com

    YAzısı çıkacak sanırım ?
  • file dosyasi nedemek yani sunucudan yuklemeliisiniz yaziyor sunucudami olmasi lazim o dosyalarin veya pleskde
  • peki soulmashertsk kardesim o texti nereeye yuklemem gerek pleske mi reselemii nasil yapacam
    if (substr($_SERVER['HTTP_HOST'], 0, 4) == "www.") { //alan adi degiskeni bazi sunucularda www ile basliyor bazilarinda www. suz ondan böyle bir degiskene ihtiyac var
    $domainadi = substr($_SERVER['HTTP_HOST'], 4);
    } else {
    $domainadi = $_SERVER['HTTP_HOST'];
    }
    return $domainadi;
    }
    $alanadi=soullisanskontrol();//yormasin her seferinde 1 kez buffera alalim yeter

    $lisanstext=file($cekilecek_text,FILE_IGNORE_NEW_LINES); //yüklediginiz text dosyasinin adresi
    $lisans=array();//bos dizi olusturduk önce yeni olusacak kontrol dizisi için
  • senin kafan baya karışmış..
    bak kodda zaten ayar yeri var

    //AYARLAR KISMI
    $cekilecek_text="http://www.site.com/cekilecek_text_dosyasi.txt"; //bir sunucuya yüklediğiniz lisanslanmasına izin veridğiniz alan adlarının olduğu text dosyası, tavsiyem googlepages.com gibi 24 saat açık olmasına güvenilir bir sunucuya yüklemenizdir
    //AYARLAR KISMI BİTTİ

    http://www.site.com/cekilecek_text_dosyasi.txt
    böyle yüklü text dosyası yani
    altına dokanmana gerek yok
  • arkadalsar text dosyasının icinde ne olmasi gerekiyor onu analamadim nasıl yapıaz
  • text dosyası içinde sadece site adresleri olmalı
    site1.com
    site2.com
    site3.com
    gibi
  • asdcan
    Merhaba güzel bir yöntem...
    Bunu kullanacağımız sunucularda ek özellik olması gerekiyor mu?
    ya da şöyle sorayim: hangi ek özellikler olması lazım?
  • teşekkürler:)
    Serverda uzaktan erişim ayarı açık olmalı. file() ya da file_get_contents() fonksiyonlarının bazı sunucularda localhost dışındaki yerlere erişimi engellenmiş oluyor
  • arkadaslar bu liisans asp yapamiyormuyuz yardim edermisiniz birde text dosyasi neerde
  • php için bu. text dosyasını istediğiniz yere yükleyebilirsiniz kendiniz oluşturacaksınız
  • Ahmet
    google pages kapandı txt dosyasını nereye yüklememizi tavsiye edersiniz
    Paylaşım için teşekkürler
  • ben halen google pages kullanıyorum ve sorun yaşamıyorum. awardspace.com, bplaced.net gibi yerler de işinizi görecektir. ya da hostinginize güveniyorsanız kendi hosting sitenize yükleyebilirsiniz
  • sukru
    Kardeş kodları denedim süper çalşıyor, ioncube ile şifreledim sorun süper oldu, çok teşşekür ederimm.
  • Pratik bir çözüm,
    ama bir intranet uygulamasında kullanamazsınız, çoğu networkler internete kapalı.
    dolayısıyla çalışmayacaktır.
  • deneme
    eger include veya require komutları config.php den kaldırılırsa , bi anlamı kalmayacak bu kadar çalışmanın ?
  • admin
    o da şifreleme kısmında yaratıcılığınıza kalmış, dahil edilmesi mecburi olan bir dosya ile config.php (ya da artık kodlar hangi dosyadaysa onu) ioncbe, zend gibi bir sistem ile şifrelerseniz adam istese de silemez, silse de sitesi/scripti çalışmaz ;)
blog comments powered by Disqus
logo
logo
Powered by Wordpress | Designed by Elegant Themes