【问题标题】:Base64 encoder formBase64编码器形式
【发布时间】:2016-09-08 03:24:12
【问题描述】:

我想知道如何使用表单创建 Base64 编码器?

就像那些你在文本框中输入文本的网站,按下编码按钮,编码的文本会出现在另一个文本框中。

谢谢。

【问题讨论】:

标签: php html base64 encode


【解决方案1】:

page.html

<form action="action.php" method="post">
 <p>String to base64 encode: <input type="text" name="string" /></p>
 <p><input type="submit" /></p>
</form>

action.php

$string = isset($_POST['string']) ? $_POST['string'] : "";
echo base64_encode($string);

【讨论】:

    猜你喜欢
    • 2018-09-09
    • 2011-05-18
    • 2014-10-18
    • 2016-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-09
    相关资源
    最近更新 更多