开发者

How do I put a notice reminder when somebody remove the powered on my theme footer

开发者 https://www.devze.com 2022-12-28 09:06 出处:网络
Example link on my footer $powered = \'Powered by <a href=\"htp://stackoverflow开发者_JS百科.com\">Stackoverflow</a>\';

Example link on my footer

$powered = 'Powered by <a href="htp://stackoverflow开发者_JS百科.com">Stackoverflow</a>';

theme file

<?php echo $powered; ?>

How to make if $powered removed from my footer and the error/reminder notice it.

Example die('Do not remove the powered link')


Short answer: not possible.


Long answer:

<?php

$powered = 'Powered by <a href="htp://stackoverflow.com">Stackoverflow</a>';

ob_start();
echo $powered;
$html = ob_get_clean();

/*
 * If you remove the "echo $powered;" part, please don't remove the following lines
 * so I can detect the license violation. Thank you for your cooperation!
 */
if( strpos($html, $powered)===FALSE ){
    echo die('Do not remove the powered link');
}else{
    echo $html;
}

?>


It's possible... you can use Zend Guard to protect your code from being altered.

0

精彩评论

暂无评论...
验证码 换一张
取 消