您的位置:首页 > 职场人生

简单实用的base64字符串编解码页面

2009-03-22 10:07 218 查看
【小蜗牛闲情之作



我经常需要用到base64字符串编码解码来做测试,使用php的base64编解码函数容易实现,下面这个页面是我自己的常用工具:

base64_encodec.php

<?php
header("content-type: text/html; charset=utf-8");
$encoded_string = base64_encode($_POST['chars']);
$decoded_string = base64_decode($_POST['chars']);
?>

<table align="center">
<h1>Base64 字符串编解码</h1>
</table>

<table align="center">
<form name="base64" method="post">

请输入字符串:<br>
<textarea name="chars" rows=4 cols=60></textarea><br><br>

Base64 编码:<br>
<textarea name="encoded" rows=4 cols=60><?php if ($_POST['encode']) echo $encoded_string ?></textarea><br><br>
<input type=submit name="encode" value="编码"><br><br>

Base64 解码:<br>
<textarea name="decoded" rows=4 cols=60><?php if ($_POST['decode']) echo $decoded_string ?></textarea><br><br>
<input type=submit name="decode" value="解码">

</form>
</table>

------------------------------------------------------------------------------------------
赵小蜗牛
QQ: 755721501
E-mail: [email]snailwarrior@qq.com[/email]
在不断奉献中谋求生存发展、打造自己的优秀品质,用人性最本质最动人的一面“营销”自己!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息