我的页脚上的示例链接
$powered = 'Powered by <a href="htp://stackoverflow.com">Stackoverflow</a>';
主题文件
<?php echo $powered; ?>
如果从我的页脚中删除$powered
并且错误/提醒通知它,如何制作。
示例die('Do not remove the powered link')
答案 0 :(得分:6)
简短回答:不可能。
答案 1 :(得分:2)
可能......您可以使用Zend Guard来保护您的代码不被更改。
答案 2 :(得分:2)
答案很长:
<?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;
}
?>