首页 > 运营 > 帮助中心 > 正文

BO-BLOG的base64编码和解码

2020-09-12 13:04:03
字体:
来源:转载
供稿:网友
  很多人遇到BO-BLOG插件或模块里面出现的类似下面这样的代码
<php>Z2xvYmFsICRsYW5nZnJvbnQsICR0ZW1wbGF0ZTsNCiRsYW5nZm</php>
 这一部分,也就是被 <php></php>包围起来的部分,就是base64_encode后的php代码。

 下面给出解决方法!
 以下请另存为 decodephp.php,直接打开就能用了。
<?PHP
error_reporting(E_ERROR | E_WARNING | E_PARSE);
@set_magic_quotes_runtime (0);
@header("Content-Type: text/html; charset=utf-8");
$code=$_POST['code'];
$action=$_REQUEST['action'];
if (get_magic_quotes_gpc()) $code=stripslashes($code);

if ($action=='decode') {
    $code=base64_decode($code);
    $code=nl2br(htmlspecialchars($code));
}
else $code=base64_encode($code);
?>

<html>
<body style="text-align: center;">
<div style="text-align: left; width: 90%; font-family: Verdana; font-size: 14px; margin: auto; background: #EFEFEF; color: #000;"><b>Result: </b><br><br><?php echo ($code);?><br><br></div><br><br>
<form action="decodephp.php" method='post'>
<textarea name='code' cols='100' rows='16'></textarea><br>
<input type='radio' name='action' value='decode' checked>DECODE &nbsp; &nbsp; <input type='radio' name='action' value='encode'>ENCODE<br><br>
<input type='submit'> &nbsp; &nbsp; <input type='reset'>
</form>
</body>
</html>

 将侧边栏模板切换器的编码部分(不包含<php>和</php>)拷贝到输入框内,解码后的结果为:
<?
global $langfront, $template;
$langforselskin=($langfront=='zh-tw') ? '恢' : '恢复默认';
include_once ("data/cache_skinlist.php");
if (is_array($skinset)) {
foreach ($skinset as $skin) {
@list($skid, $skname, $skauthor, $skintro, $skdir, $skthumbnail)[email protected]('|', $skin);
if ($skid==$template['id']) $optionskinlist.="<option value='{$skdir}' selected='selected'>{$skname}</option>";
else $optionskinlist.="<option value='{$skdir}'>{$skname}</option>";
}
}
$phpreturn="<form action='index.php' method='post' id='skinselector'><select name='tem' onchange=/"document.getElementById('skinselector').submit();/"><option value='____'>{$langforselskin}</option>{$optionskinlist}</select></form>";
?> 
 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表