PDA

View Full Version : Flat file licenceing



DeejayMachoo$
27-10-2007, 07:05 PM
<?
$domain = $_SERVER['HTTP_HOST'];
$fp = fopen('http://thinktropica.com/licence.txt','r');
if (!$fp) {
echo ("Licence file is non-exestient");
exit;
}
while (!feof($fp)) {
$line = fgets($fp, 1024);
list ($site1, $site2, $site3) = split ('\|', $line);
if ($site1 == ($domain)) {
echo("You have a licence :O");
} else {
if ($site2 == ($domain)) {
echo("You have a licence :O");
} else {
if ($site3 == ($domain)) {
echo("You have a licence :O");
} else {
echo("This Domain has no valid licence. Sorry");
}
}
}
$fp++;
}

fclose($fp);

?>

Right iv done this but im not sure how to so it so instead of having $site1, $site2, ect.. i can just use $sites

and it will check if hello.com|hilloooglgg.com|woof.org|

instead of defining each one meaning hello.com = $site1 ect..

any ideas?

Tomm
27-10-2007, 08:50 PM
foreach($thearray as $key => $value) {
//do stuff here.
}

DeejayMachoo$
27-10-2007, 09:09 PM
thanks mate :)

Beau
29-10-2007, 08:18 AM
Can I point out, it'd be rather easy to take that out of your code, which would make the application work regardless of whether you were liscenced. Also, it's rather insecure having all the sites that your application is used by in a text file. If I were you, I'd be using some sort of database on your side. The script would go to a PHP file on your server (eg. ./checkliscence?site=www.site.com). If the site was licenced, it would echo back yes, you would continue. If it wasn't liscenced, echo no, script halts.

DeejayMachoo$
29-10-2007, 09:11 AM
dont worry im not dumb enough to just let people take the code out am i?

im going to make that code dependent in alot of files and if it isnt there in the main file then it will not work also all files will be encripted.

Beau
29-10-2007, 09:37 AM
Files will be encrypted? I'm intrigued. Please explain further.

Tomm
29-10-2007, 09:40 AM
Don't place a license check in loads of files as this will cause inconvenience to the user as well as bog down your server.


dont worry im not dumb enough to just let people take the code out am i?

im going to make that code dependent in alot of files and if it isnt there in the main file then it will not work also all files will be encripted.

DeejayMachoo$
29-10-2007, 09:54 AM
Files will be encrypted? I'm intrigued. Please explain further.


<?php $_F=__FILE__;$_X='Pz4gPD8NCiAkZDJtMTRuID0gJF9TRVJW RVJbJ0hUVFBfSE9TVCddOw0KICRmcCAgPSBmNGw1KCdodHRwOi 8vdGg0bmt0cjJwNGMxLmMybS9sNGM1bmM1LnR4dCcpOw0KZjJy NTFjaCgkZnAgMXMgJGs1eSA9PiAkdjFsKSANCnsNCiAgICAgJG QxdDFbJGs1eV0gPSA1eHBsMmQ1KCJ8fCIsICR2MWwpOw0KfQ0K DQpmMnIoJGsgPSAwOyAkayA8IHM0ejUyZigkZnApOyAkaysrKS ANCnsgDQogIDRmICgkZDF0MVska11bMF0gPT0gJGQybTE0bikg eyANCjVjaDIoIlNjcjRwdCA0bmNsM3M0Mm4gdzRsbCBiNSBoNX I1IDopIik7DQp9IDVsczUgeyANCjVjaDIoIiRkMm0xNG4gSDFz IG4yIGw0YzVuYzUuIik7DQp9DQp9DQo/Pg==';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUo JF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdW llMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18n LCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD 0wOw=='));?>

Put that on your server then look @ it then tell me your domain and ill give it license.

Tomm
29-10-2007, 09:58 AM
Thats not really encoded though.


<?
$domain = $_SERVER['HTTP_HOST'];
$fp = file('http://thinktropica.com/licence.txt');
foreach($fp as $key => $val)
{
$data[$key] = explode("||", $val);
}

for($k = 0; $k < sizeof($fp); $k++)
{
if ($data[$k][0] == $domain) {
echo("Script inclusion will be here :)");
} else {
echo("$domain Has no licence.");
}
}
?>

If you want drop me a PM and I can encode it with Zend Encoder for you.




<?php $_F=__FILE__;$_X='Pz4gPD8NCiAkZDJtMTRuID0gJF9TRVJW RVJbJ0hUVFBfSE9TVCddOw0KICRmcCAgPSBmNGw1KCdodHRwOi 8vdGg0bmt0cjJwNGMxLmMybS9sNGM1bmM1LnR4dCcpOw0KZjJy NTFjaCgkZnAgMXMgJGs1eSA9PiAkdjFsKSANCnsNCiAgICAgJG QxdDFbJGs1eV0gPSA1eHBsMmQ1KCJ8fCIsICR2MWwpOw0KfQ0K DQpmMnIoJGsgPSAwOyAkayA8IHM0ejUyZigkZnApOyAkaysrKS ANCnsgDQogIDRmICgkZDF0MVska11bMF0gPT0gJGQybTE0bikg eyANCjVjaDIoIlNjcjRwdCA0bmNsM3M0Mm4gdzRsbCBiNSBoNX I1IDopIik7DQp9IDVsczUgeyANCjVjaDIoIiRkMm0xNG4gSDFz IG4yIGw0YzVuYzUuIik7DQp9DQp9DQo/Pg==';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUo JF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdW llMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18n LCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD 0wOw=='));?>Put that on your server then look @ it then tell me your domain and ill give it license.

Beau
29-10-2007, 10:00 AM
Oh Zend Encoder... Forgive me, I thought you were talking about something else :P

I still think you should be using some sort of check on your site through a database, rather than a text file >_>

DeejayMachoo$
29-10-2007, 10:01 AM
text file is just easier for me :) i endup deleting databases ect and this is quick and easy to make again :)

Tomm
29-10-2007, 10:06 AM
If you have alot of licenses then it could take a rather long time to process the license text file.


text file is just easier for me :) i endup deleting databases ect and this is quick and easy to make again :)

DeejayMachoo$
29-10-2007, 10:07 AM
If you have alot of licenses then it could take a rather long time to process the license text file.

well if what ever i make gets popular ill change to a sql :)


<?php @Zend;
4147;
/* ñ!This is not a text file!Þí */
print <<<EOM
<html><body><a href="http://www.zend.com/store/products/zend-safeguard-suite.php"><img border="0" src="http://www.zend.com/images/store/safeguard_optimizer_img.gif" align="right"></a><center><h1>Zend Optimizer not installed</h1></center><p>This file was encoded by the <a href="http://www.zend.com/products/zend_guard">Zend Guard</a>. In order to run it, please install the <a href="http://www.zend.com/products/zend_optimizer">Zend Optimizer</a> (available without charge), version 3.0.0 or later. </p><h2>Seeing this message instead of the website you expected?</h2>This means that this webserver is not configured correctly. In order to view this website properly, please contact the website's system administrator/webmaster with the following message:<br><br><tt>The component "Zend Optimizer" is not installed on the Web Server and therefore cannot service encoded files. Please download and install the Zend Optimizer (available without charge) on the Web Server.</tt><br><br><b>Note</b>: Zend Technologies cannot resolve issues related to this message appearing on websites not belonging to <a href="http://www.zend.com">Zend Technologies</a>. <h2>What is the Zend Optimizer?</h2><p>The Zend Optimizer is one of the most popular PHP plugins for performance-improvement, and has been available without charge, since the early days of PHP 4. It improves performance by scanning PHP's intermediate code and passing it through multiple Optimization Passes to replace inefficient code patterns with more efficient code blocks. The replaced code blocks perform exactly the same operations as the original code, only faster. </p><p>In addition to improving performance, the Zend Optimizer also enables PHP to transparently load files encoded by the Zend Guard. </p><p>The Zend Optimizer is a free product available for download from <a href="http://www.zend.com">Zend Technologies</a>. Zend Technologies also developed the PHP scripting engine, known as the <a href="http://www.zend.com/products/zend_engine">Zend Engine</a>.</p></body></html>
EOM;
exit();
__halt_compiler();
?>

20060228011036851685xù
Ÿ2 }W½nA^#Y6RÜG £HAA|û—†*Š;D@P sw(—Øgã8
ˆÐñ4Ht<@ÉPPú(ÙÙ¿»*DÈ¿w3·ûÍìü|ÅÿEÕ” af­ši=›Ó¼OFçTÈ4§RýO© \䪦hNP^,ï÷ge¹JÇÐ^ÿb‰ %œI˜˜ÊEõö´8rÁ±Ì0!Àƒ?$>^Þ¾óSÊyªôs|jMFõÈã È
Œ{Ã|ïÄ©ªRâøùáqG‰ {7ženuúøé3£öÕç8È #;² ºŸÍSæ6¡èSôåªbnV“‰Š­æl³^®êb•h2¯ ‹ª)ªýÍ;S±.j‰*¸b‚%ZCzˆ8‚HÑO{5îP+óC8 qÈús#¡wQò­ïêuº¯§2fшÒ3´ÕW ³¼·{¿¼¬–M½¯±÷5ÌkHt7
‚®®ºž”h×*XX3[á(‘|p:”>Û`›9fÜ‚—`4팢ý®Œzðy'^zzŽùa¯ºõÛ¡Nö bdØw¿,i}™‹?PimnÙ¨±¤£0ø]òµ@É‘B ¢T@øÅ™cçÆ©Ô<ËBZÃAøÛÁ‡.¸¤O|ä²Îî=CûwBò:† Ӑ~Û2©„2†¬Š—Û– m”±ªÁëz¥(pSÌ/Îëe“\ÖóyòºJNªu•<覈·Få±Q *ï§Ürô׏AiŒúšÐ ’éì<i–‰+ V¿Yì´ýH‰^:ýÚŠ3×f¼ËåbV7ªX3Š9Îk‚ Þ¬†ª/0Œ ×J×#’fYʤzÁ5Jè;Xe0Õù
xˆÍsN±>³W áó(Eÿ)óÁ

Tomm
29-10-2007, 10:20 AM
Are you using a trial?


well if what ever i make gets popular ill change to a sql :)


<?php @Zend;
4147;
/* ñ!This is not a text file!Þí */
print <<<EOM
<html><body><a href="http://www.zend.com/store/products/zend-safeguard-suite.php"><img border="0" src="http://www.zend.com/images/store/safeguard_optimizer_img.gif" align="right"></a><center><h1>Zend Optimizer not installed</h1></center><p>This file was encoded by the <a href="http://www.zend.com/products/zend_guard">Zend Guard</a>. In order to run it, please install the <a href="http://www.zend.com/products/zend_optimizer">Zend Optimizer</a> (available without charge), version 3.0.0 or later. </p><h2>Seeing this message instead of the website you expected?</h2>This means that this webserver is not configured correctly. In order to view this website properly, please contact the website's system administrator/webmaster with the following message:<br><br><tt>The component "Zend Optimizer" is not installed on the Web Server and therefore cannot service encoded files. Please download and install the Zend Optimizer (available without charge) on the Web Server.</tt><br><br><b>Note</b>: Zend Technologies cannot resolve issues related to this message appearing on websites not belonging to <a href="http://www.zend.com">Zend Technologies</a>. <h2>What is the Zend Optimizer?</h2><p>The Zend Optimizer is one of the most popular PHP plugins for performance-improvement, and has been available without charge, since the early days of PHP 4. It improves performance by scanning PHP's intermediate code and passing it through multiple Optimization Passes to replace inefficient code patterns with more efficient code blocks. The replaced code blocks perform exactly the same operations as the original code, only faster. </p><p>In addition to improving performance, the Zend Optimizer also enables PHP to transparently load files encoded by the Zend Guard. </p><p>The Zend Optimizer is a free product available for download from <a href="http://www.zend.com">Zend Technologies</a>. Zend Technologies also developed the PHP scripting engine, known as the <a href="http://www.zend.com/products/zend_engine">Zend Engine</a>.</p></body></html>
EOM;
exit();
__halt_compiler();
?>

20060228011036851685xù
Ÿ2 }W½nA^#Y6RÜG £HAA|û—†*Š;D@P sw(—Øgã8
ˆÐñ4Ht<@ÉPPú(ÙÙ¿»*DÈ¿w3·ûÍìü|ÅÿEÕ Éaf­ši=›Ó¼OFçTÈ4§RýO© \䪦hNP^,ï÷ge¹JÇÐ^ÿb‰ %œI˜˜ÊEõö´8rÁ±Ì0!Àƒ?$>^Þ¾óSÊyªôs|jMFõÈã È
Œ{Ã|ïÄ©ªRâøùáqG‰ {7ženuúøé3£öÕç8È #;² ºŸÍSæ6¡èSôåªbnV“‰Š­æl³^®êb •h2¯‹ª)ªýÍ;S±.j‰*¸b‚%ZCzˆ8 HÑO{5îP+óC8qÈús#¡wQò­ïêuº¯§2f ˆÒ3´ÕW ³¼·{¿¼¬–M½¯±÷5ÌkHt7
‚®®ºž”h×*XX3[á(‘|p:”>Û`›9fÜ‚—`4팢ý®Œzðy'^zzŽùa¯ºõ Û¡NöbdØw¿,i}™‹?PimnÙ¨±¤£0ø]òµ@É‘B ¢T@øÅ™cçÆ©Ô<ËBZÃAøÛÁ‡.¸¤O|ä²Îî=CûwBò:† Ӑ~Û2©„2†¬Š—Û– m”±ªÁëz¥(pSÌ/Îëe“\ÖóyòºJNªu•<覈·Få±Q *ï§Ürô׏AiŒúšÐ ’éì<i–‰+ V¿Yì´ýH‰^:ýÚŠ3×f¼ËåbV7ªX3Š9Î k‚Þ¬†ª/0Œ ×J×#’fYʤzÁ5Jè;Xe0Õù
xˆÍsN±>³W áó(Eÿ)óÁ

DeejayMachoo$
29-10-2007, 10:22 AM
Are you using a trial?no i downloaded a crack for it but i dont think it worked well >.<

Tomm
29-10-2007, 10:23 AM
Yeah I found that too.


no i downloaded a crack for it but i dont think it worked well >.<

DeejayMachoo$
29-10-2007, 10:25 AM
Yeah I found that too.
what so did u buy it ?

Want to hide these adverts? Register an account for free!